8000 Make TableOrView public to allow TableOrView.Option to be referenced outside package. by adutra · Pull Request #463 · apache/cassandra-java-driver · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/README.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [bug] Fix Configuration builder to allow disabled metrics (JAVA-900)
- [new feature] Prepare API for async query trace (JAVA-902)
- [new feature] Add BoundStatement#unset (JAVA-930)
- [bug] Make table metadata options class visible (JAVA-946)


### 3.0.0-alpha3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private MaterializedViewMetadata(
Map<String, ColumnMetadata> columns,
boolean includeAllColumns,
String whereClause,
Options options,
TableOptionsMetadata options,
List<Order> clusteringOrder,
VersionNumber cassandraVersion) {
super(keyspace, name, id, partitionKey, clusteringColumns, columns, options, clusteringOrder, cassandraVersion);
Expand All @@ -74,16 +74,17 @@ static MaterializedViewMetadata build(KeyspaceMetadata keyspace, Row row, Map<St

int partitionKeySize = findCollectionSize(rawCols.values(), ColumnMetadata.Raw.Kind.PARTITION_KEY);
int clusteringSize = findCollectionSize(rawCols.values(), ColumnMetadata.Raw.Kind.CLUSTERING_COLUMN);
List<ColumnMetadata> partitionKey = nullInitializedList(partitionKeySize);
List<ColumnMetadata> clusteringColumns = nullInitializedList(clusteringSize);
List<Order> clusteringOrder = nullInitializedList(clusteringSize);

List<ColumnMetadata> partitionKey = new ArrayList<ColumnMetadata>(Collections.<ColumnMetadata>nCopies(partitionKeySize, null));
List<ColumnMetadata> clusteringColumns = new ArrayList<ColumnMetadata>(Collections.<ColumnMetadata>nCopies(clusteringSize, null));
List<Order> clusteringOrder = new ArrayList<Order>(Collections.<Order>nCopies(clusteringSize, null));

// We use a linked hashmap because we will keep this in the order of a 'SELECT * FROM ...'.
LinkedHashMap<String, ColumnMetadata> columns = new LinkedHashMap<String, ColumnMetadata>();

Options options = null;
TableOptionsMetadata options = null;
try {
options = new Options(row, false, cassandraVersion);
options = new TableOptionsMetadata(row, false, cassandraVersion);
} catch (RuntimeException e) {
// See ControlConnection#refreshSchema for why we'd rather not probably this further. Since table options is one thing
// that tends to change often in Cassandra, it's worth special casing this.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
*/
package com.datastax.driver.core;


import java.util.*;

import com.google.common.base.*;
import com.google.common.base.Objects;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -63,7 +61,7 @@ private TableMetadata(KeyspaceMetadata keyspace,
List<ColumnMetadata> clusteringColumns,
Map<String, ColumnMetadata> columns,
Map<String, IndexMetadata> indexes,
Options options,
TableOptionsMetadata options,
List<Order> clusteringOrder,
VersionNumber cassandraVersion) {
super(keyspace, name, id, partitionKey, clusteringColumns, columns, options, clusteringOrder, cassandraVersion);
Expand Down Expand Up @@ -123,17 +121,17 @@ else if (cassandraVersion.getMajor() > 2)
isCompact = isDense || !comparator.isComposite;
}

List<ColumnMetadata> partitionKey = nullInitializedList(partitionKeySize);
List<ColumnMetadata> clusteringColumns = nullInitializedList(clusteringSize);
List<Order> clusteringOrder = nullInitializedList(clusteringSize);
List<ColumnMetadata> partitionKey = new ArrayList<ColumnMetadata>(Collections.<ColumnMetadata>nCopies(partitionKeySize, null));
List<ColumnMetadata> clusteringColumns = new ArrayList<ColumnMetadata>(Collections.<ColumnMetadata>nCopies(clusteringSize, null));
List<Order> clusteringOrder = new ArrayList<Order>(Collections.<Order>nCopies(clusteringSize, null));

// We use a linked hashmap because we will keep this in the order of a 'SELECT * FROM ...'.
LinkedHashMap<String, ColumnMetadata> columns = new LinkedHashMap<String, ColumnMetadata>();
LinkedHashMap<String, IndexMetadata> indexes = new LinkedHashMap<String, IndexMetadata>();

Options options = null;
TableOptionsMetadata options = null;
try {
options = new Options(row, isCompact, cassandraVersion);
options = new TableOptionsMetadata(row, isCompact, cassandraVersion);
} catch (RuntimeException e) {
// See ControlConnection#refreshSchema for why we'd rather not probably this further. Since table options is one thing
// that tends to change often in Cassandra, it's worth special casing this.
Expand Down
Loading
0