Skip to content

Commit 26dd9c6

Browse files
author
Sylvain Lebresne
committed
Fix too agressive refactor
1 parent 2eb98d0 commit 26dd9c6

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

driver-core/src/main/java/com/datastax/driver/core/ColumnMetadata.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public String toString() {
183183
// Temporary class that is used to make building the schema easier. Not meant to be
184184
// exposed publicly at all.
185185
static class Raw {
186-
public enum Kind { PARTITION_KEY, CLUSTERING_COLUMN, REGULAR, COMPACT_VALUE }
186+
public enum Kind { PARTITION_KEY, CLUSTERING_KEY, REGULAR, COMPACT_VALUE }
187187

188188
public final String name;
189189
public final Kind kind;

driver-core/src/main/java/com/datastax/driver/core/TableMetadata.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static TableMetadata build(KeyspaceMetadata ksm, Row row, Map<String, ColumnMeta
116116
case PARTITION_KEY:
117117
partitionKey.set(rawCol.componentIndex, col);
118118
break;
119-
case CLUSTERING_COLUMN:
119+
case CLUSTERING_KEY:
120120
clusteringColumns.set(rawCol.componentIndex, col);
121121
clusteringOrder.set(rawCol.componentIndex, rawCol.isReversed ? Order.DESC : Order.ASC);
122122
break;
@@ -137,7 +137,7 @@ static TableMetadata build(KeyspaceMetadata ksm, Row row, Map<String, ColumnMeta
137137
private static int findClusteringSize(Collection<ColumnMetadata.Raw> cols) {
138138
int maxId = -1;
139139
for (ColumnMetadata.Raw col : cols)
140-
if (col.kind == ColumnMetadata.Raw.Kind.CLUSTERING_COLUMN)
140+
if (col.kind == ColumnMetadata.Raw.Kind.CLUSTERING_KEY)
141141
maxId = Math.max(maxId, col.componentIndex);
142142
return maxId + 1;
143143
}

driver-core/src/test/java/com/datastax/driver/core/LoadBalancingPolicyTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public void tokenAwareWithRF2Test() throws Throwable {
337337
init(c, 12);
338338
query(c, 12);
339339

340-
// Not the best test ever, we should use OPP and check we do it the
340+
// Not the best test ever, we should use OPP and check we do hit the
341341
// right nodes. But since M3P is hard-coded for now, let just check
342342
// we just hit only one node.
343343
assertQueried(CCMBridge.IP_PREFIX + "1", 0);
@@ -362,11 +362,9 @@ public void tokenAwareWithRF2Test() throws Throwable {
362362
query(c, 12);
363363

364364
// Still only one node since RF=2
365-
// TODO: this is broken because token awareness does not yet take the replication factor into
366-
// account (JAVA-88). Once fixed, we should re-enable this
367-
//assertQueried(CCMBridge.IP_PREFIX + "1", 12);
368-
//assertQueried(CCMBridge.IP_PREFIX + "2", 0);
369-
//assertQueried(CCMBridge.IP_PREFIX + "3", 0);
365+
assertQueried(CCMBridge.IP_PREFIX + "1", 12);
366+
assertQueried(CCMBridge.IP_PREFIX + "2", 0);
367+
assertQueried(CCMBridge.IP_PREFIX + "3", 0);
370368

371369
} catch (Throwable e) {
372370
c.errorOut();

0 commit comments

Comments
 (0)