repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/compress/CompressionMetadata.java
CompressionMetadata.create
public static CompressionMetadata create(String dataFilePath) { Descriptor desc = Descriptor.fromFilename(dataFilePath); return new CompressionMetadata(desc.filenameFor(Component.COMPRESSION_INFO), new File(dataFilePath).length(), desc.version.hasPostCompressionAdlerChecksums); }
java
public static CompressionMetadata create(String dataFilePath) { Descriptor desc = Descriptor.fromFilename(dataFilePath); return new CompressionMetadata(desc.filenameFor(Component.COMPRESSION_INFO), new File(dataFilePath).length(), desc.version.hasPostCompressionAdlerChecksums); }
[ "public", "static", "CompressionMetadata", "create", "(", "String", "dataFilePath", ")", "{", "Descriptor", "desc", "=", "Descriptor", ".", "fromFilename", "(", "dataFilePath", ")", ";", "return", "new", "CompressionMetadata", "(", "desc", ".", "filenameFor", "(",...
Create metadata about given compressed file including uncompressed data length, chunk size and list of the chunk offsets of the compressed data. This is an expensive operation! Don't create more than one for each sstable. @param dataFilePath Path to the compressed file @return metadata about given compressed file.
[ "Create", "metadata", "about", "given", "compressed", "file", "including", "uncompressed", "data", "length", "chunk", "size", "and", "list", "of", "the", "chunk", "offsets", "of", "the", "compressed", "data", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/compress/CompressionMetadata.java#L82-L86
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.reset
boolean reset(double useChance, int targetCount, boolean isWrite) { this.isWrite = isWrite; if (this.useChance < 1d) { // we clear our prior roll-modifiers if the use chance was previously less-than zero Arrays.fill(rollmodifier, 1d); ...
java
boolean reset(double useChance, int targetCount, boolean isWrite) { this.isWrite = isWrite; if (this.useChance < 1d) { // we clear our prior roll-modifiers if the use chance was previously less-than zero Arrays.fill(rollmodifier, 1d); ...
[ "boolean", "reset", "(", "double", "useChance", ",", "int", "targetCount", ",", "boolean", "isWrite", ")", "{", "this", ".", "isWrite", "=", "isWrite", ";", "if", "(", "this", ".", "useChance", "<", "1d", ")", "{", "// we clear our prior roll-modifiers if the ...
initialise the iterator state if we're a write, the expected behaviour is that the requested batch count is compounded with the seed's visit count to decide how much we should return in one iteration @param useChance uniform chance of visiting any single row (NaN if targetCount provided) @param targetCount number of ...
[ "initialise", "the", "iterator", "state" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L204-L267
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.setNoLastRow
private int setNoLastRow(int firstComponentCount) { Arrays.fill(lastRow, Integer.MAX_VALUE); return firstComponentCount * generator.clusteringDescendantAverages[0]; }
java
private int setNoLastRow(int firstComponentCount) { Arrays.fill(lastRow, Integer.MAX_VALUE); return firstComponentCount * generator.clusteringDescendantAverages[0]; }
[ "private", "int", "setNoLastRow", "(", "int", "firstComponentCount", ")", "{", "Arrays", ".", "fill", "(", "lastRow", ",", "Integer", ".", "MAX_VALUE", ")", ";", "return", "firstComponentCount", "*", "generator", ".", "clusteringDescendantAverages", "[", "0", "]...
returns expected row count
[ "returns", "expected", "row", "count" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L270-L274
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.setLastRow
private int setLastRow(int position) { if (position < 0) throw new IllegalStateException(); decompose(position, lastRow); int expectedRowCount = 0; for (int i = 0 ; i < lastRow.length ; i++) { int l = lastRow[i]; ...
java
private int setLastRow(int position) { if (position < 0) throw new IllegalStateException(); decompose(position, lastRow); int expectedRowCount = 0; for (int i = 0 ; i < lastRow.length ; i++) { int l = lastRow[i]; ...
[ "private", "int", "setLastRow", "(", "int", "position", ")", "{", "if", "(", "position", "<", "0", ")", "throw", "new", "IllegalStateException", "(", ")", ";", "decompose", "(", "position", ",", "lastRow", ")", ";", "int", "expectedRowCount", "=", "0", "...
returns expected distance from zero
[ "returns", "expected", "distance", "from", "zero" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L278-L291
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.compareToLastRow
private int compareToLastRow(int depth) { for (int i = 0 ; i <= depth ; i++) { int p = currentRow[i], l = lastRow[i], r = clusteringComponents[i].size(); if ((p == l) | (r == 1)) continue; return p - l; } ...
java
private int compareToLastRow(int depth) { for (int i = 0 ; i <= depth ; i++) { int p = currentRow[i], l = lastRow[i], r = clusteringComponents[i].size(); if ((p == l) | (r == 1)) continue; return p - l; } ...
[ "private", "int", "compareToLastRow", "(", "int", "depth", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "depth", ";", "i", "++", ")", "{", "int", "p", "=", "currentRow", "[", "i", "]", ",", "l", "=", "lastRow", "[", "i", "]", "...
OR if that row does not exist, it is the last row prior to it
[ "OR", "if", "that", "row", "does", "not", "exist", "it", "is", "the", "last", "row", "prior", "to", "it" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L297-L307
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.decompose
private void decompose(int scalar, int[] decomposed) { for (int i = 0 ; i < decomposed.length ; i++) { int avg = generator.clusteringDescendantAverages[i]; decomposed[i] = scalar / avg; scalar %= avg; } for (int i = ...
java
private void decompose(int scalar, int[] decomposed) { for (int i = 0 ; i < decomposed.length ; i++) { int avg = generator.clusteringDescendantAverages[i]; decomposed[i] = scalar / avg; scalar %= avg; } for (int i = ...
[ "private", "void", "decompose", "(", "int", "scalar", ",", "int", "[", "]", "decomposed", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "decomposed", ".", "length", ";", "i", "++", ")", "{", "int", "avg", "=", "generator", ".", "clus...
Translate the scalar position into a tiered position based on mean expected counts @param scalar scalar position @param decomposed target container
[ "Translate", "the", "scalar", "position", "into", "a", "tiered", "position", "based", "on", "mean", "expected", "counts" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L314-L331
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.seek
private State seek(int scalar) { if (scalar == 0) { this.currentRow[0] = -1; clusteringComponents[0].addFirst(this); return setHasNext(advance(0, true)); } int[] position = this.currentRow; decompose(sca...
java
private State seek(int scalar) { if (scalar == 0) { this.currentRow[0] = -1; clusteringComponents[0].addFirst(this); return setHasNext(advance(0, true)); } int[] position = this.currentRow; decompose(sca...
[ "private", "State", "seek", "(", "int", "scalar", ")", "{", "if", "(", "scalar", "==", "0", ")", "{", "this", ".", "currentRow", "[", "0", "]", "=", "-", "1", ";", "clusteringComponents", "[", "0", "]", ".", "addFirst", "(", "this", ")", ";", "re...
seek to the provided position to initialise the iterator @param scalar scalar position @return resultant iterator state
[ "seek", "to", "the", "provided", "position", "to", "initialise", "the", "iterator" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L344-L398
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.advance
void advance() { // we are always at the leaf level when this method is invoked // so we calculate the seed for generating the row by combining the seed that generated the clustering components int depth = clusteringComponents.length - 1; long parentSeed = cluster...
java
void advance() { // we are always at the leaf level when this method is invoked // so we calculate the seed for generating the row by combining the seed that generated the clustering components int depth = clusteringComponents.length - 1; long parentSeed = cluster...
[ "void", "advance", "(", ")", "{", "// we are always at the leaf level when this method is invoked", "// so we calculate the seed for generating the row by combining the seed that generated the clustering components", "int", "depth", "=", "clusteringComponents", ".", "length", "-", "1", ...
to move the iterator to the next item
[ "to", "move", "the", "iterator", "to", "the", "next", "item" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L402-L420
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.fill
void fill(int depth) { long seed = clusteringSeeds[depth - 1]; Generator gen = generator.clusteringComponents.get(depth); gen.setSeed(seed); clusteringSeeds[depth] = seed(clusteringComponents[depth - 1].peek(), generator.clusteringComponents.get(depth - 1).type, s...
java
void fill(int depth) { long seed = clusteringSeeds[depth - 1]; Generator gen = generator.clusteringComponents.get(depth); gen.setSeed(seed); clusteringSeeds[depth] = seed(clusteringComponents[depth - 1].peek(), generator.clusteringComponents.get(depth - 1).type, s...
[ "void", "fill", "(", "int", "depth", ")", "{", "long", "seed", "=", "clusteringSeeds", "[", "depth", "-", "1", "]", ";", "Generator", "gen", "=", "generator", ".", "clusteringComponents", ".", "get", "(", "depth", ")", ";", "gen", ".", "setSeed", "(", ...
to have been generated and their seeds populated into clusteringSeeds
[ "to", "have", "been", "generated", "and", "their", "seeds", "populated", "into", "clusteringSeeds" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L486-L493
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java
MultiRowIterator.fill
void fill(Queue<Object> queue, int count, Generator generator) { if (count == 1) { queue.add(generator.generate()); return; } switch (this.generator.order) { case SORTED: if (Comparab...
java
void fill(Queue<Object> queue, int count, Generator generator) { if (count == 1) { queue.add(generator.generate()); return; } switch (this.generator.order) { case SORTED: if (Comparab...
[ "void", "fill", "(", "Queue", "<", "Object", ">", "queue", ",", "int", "count", ",", "Generator", "generator", ")", "{", "if", "(", "count", "==", "1", ")", "{", "queue", ".", "add", "(", "generator", ".", "generate", "(", ")", ")", ";", "return", ...
generate the clustering components into the queue
[ "generate", "the", "clustering", "components", "into", "the", "queue" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/generate/PartitionIterator.java#L496-L548
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogService.java
AbstractCommitLogService.requestExtraSync
public WaitQueue.Signal requestExtraSync() { WaitQueue.Signal signal = syncComplete.register(); haveWork.release(1); return signal; }
java
public WaitQueue.Signal requestExtraSync() { WaitQueue.Signal signal = syncComplete.register(); haveWork.release(1); return signal; }
[ "public", "WaitQueue", ".", "Signal", "requestExtraSync", "(", ")", "{", "WaitQueue", ".", "Signal", "signal", "=", "syncComplete", ".", "register", "(", ")", ";", "haveWork", ".", "release", "(", "1", ")", ";", "return", "signal", ";", "}" ]
Sync immediately, but don't block for the sync to cmplete
[ "Sync", "immediately", "but", "don", "t", "block", "for", "the", "sync", "to", "cmplete" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogService.java#L160-L165
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
YamlConfigurationLoader.getStorageConfigURL
static URL getStorageConfigURL() throws ConfigurationException { String configUrl = System.getProperty("cassandra.config"); if (configUrl == null) configUrl = DEFAULT_CONFIGURATION; URL url; try { url = new URL(configUrl); url.openStream()...
java
static URL getStorageConfigURL() throws ConfigurationException { String configUrl = System.getProperty("cassandra.config"); if (configUrl == null) configUrl = DEFAULT_CONFIGURATION; URL url; try { url = new URL(configUrl); url.openStream()...
[ "static", "URL", "getStorageConfigURL", "(", ")", "throws", "ConfigurationException", "{", "String", "configUrl", "=", "System", ".", "getProperty", "(", "\"cassandra.config\"", ")", ";", "if", "(", "configUrl", "==", "null", ")", "configUrl", "=", "DEFAULT_CONFIG...
Inspect the classpath to find storage configuration file
[ "Inspect", "the", "classpath", "to", "find", "storage", "configuration", "file" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java#L53-L80
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/ColumnDefinition.java
ColumnDefinition.deleteFromSchema
public void deleteFromSchema(Mutation mutation, long timestamp) { ColumnFamily cf = mutation.addOrGet(CFMetaData.SchemaColumnsCf); int ldt = (int) (System.currentTimeMillis() / 1000); // Note: we do want to use name.toString(), not name.bytes directly for backward compatibility (For CQL3, t...
java
public void deleteFromSchema(Mutation mutation, long timestamp) { ColumnFamily cf = mutation.addOrGet(CFMetaData.SchemaColumnsCf); int ldt = (int) (System.currentTimeMillis() / 1000); // Note: we do want to use name.toString(), not name.bytes directly for backward compatibility (For CQL3, t...
[ "public", "void", "deleteFromSchema", "(", "Mutation", "mutation", ",", "long", "timestamp", ")", "{", "ColumnFamily", "cf", "=", "mutation", ".", "addOrGet", "(", "CFMetaData", ".", "SchemaColumnsCf", ")", ";", "int", "ldt", "=", "(", "int", ")", "(", "Sy...
Drop specified column from the schema using given mutation. @param mutation The schema mutation @param timestamp The timestamp to use for column modification
[ "Drop", "specified", "column", "from", "the", "schema", "using", "given", "mutation", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/ColumnDefinition.java#L316-L324
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/ColumnDefinition.java
ColumnDefinition.fromSchema
public static List<ColumnDefinition> fromSchema(UntypedResultSet serializedColumns, String ksName, String cfName, AbstractType<?> rawComparator, boolean isSuper) { List<ColumnDefinition> cds = new ArrayList<>(); for (UntypedResultSet.Row row : serializedColumns) { Kind kind = row...
java
public static List<ColumnDefinition> fromSchema(UntypedResultSet serializedColumns, String ksName, String cfName, AbstractType<?> rawComparator, boolean isSuper) { List<ColumnDefinition> cds = new ArrayList<>(); for (UntypedResultSet.Row row : serializedColumns) { Kind kind = row...
[ "public", "static", "List", "<", "ColumnDefinition", ">", "fromSchema", "(", "UntypedResultSet", "serializedColumns", ",", "String", "ksName", ",", "String", "cfName", ",", "AbstractType", "<", "?", ">", "rawComparator", ",", "boolean", "isSuper", ")", "{", "Lis...
Deserialize columns from storage-level representation @param serializedColumns storage-level partition containing the column definitions @return the list of processed ColumnDefinitions
[ "Deserialize", "columns", "from", "storage", "-", "level", "representation" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/ColumnDefinition.java#L379-L425
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/serializers/MapSerializer.java
MapSerializer.getSerializedValue
public ByteBuffer getSerializedValue(ByteBuffer serializedMap, ByteBuffer serializedKey, AbstractType keyType) { try { ByteBuffer input = serializedMap.duplicate(); int n = readCollectionSize(input, Server.VERSION_3); for (int i = 0; i < n; i++) { ...
java
public ByteBuffer getSerializedValue(ByteBuffer serializedMap, ByteBuffer serializedKey, AbstractType keyType) { try { ByteBuffer input = serializedMap.duplicate(); int n = readCollectionSize(input, Server.VERSION_3); for (int i = 0; i < n; i++) { ...
[ "public", "ByteBuffer", "getSerializedValue", "(", "ByteBuffer", "serializedMap", ",", "ByteBuffer", "serializedKey", ",", "AbstractType", "keyType", ")", "{", "try", "{", "ByteBuffer", "input", "=", "serializedMap", ".", "duplicate", "(", ")", ";", "int", "n", ...
Given a serialized map, gets the value associated with a given key. @param serializedMap a serialized map @param serializedKey a serialized key @param keyType the key type for the map @return the value associated with the key if one exists, null otherwise
[ "Given", "a", "serialized", "map", "gets", "the", "value", "associated", "with", "a", "given", "key", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/serializers/MapSerializer.java#L126-L149
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/btree/BTree.java
BTree.build
public static <V> Object[] build(Iterable<V> source, int size, Comparator<V> comparator, boolean sorted, UpdateFunction<V> updateF) { if (size < FAN_FACTOR) { // pad to even length to match contract that all leaf nodes are even V[] values = (V[]) new Object[size + (size & 1)]...
java
public static <V> Object[] build(Iterable<V> source, int size, Comparator<V> comparator, boolean sorted, UpdateFunction<V> updateF) { if (size < FAN_FACTOR) { // pad to even length to match contract that all leaf nodes are even V[] values = (V[]) new Object[size + (size & 1)]...
[ "public", "static", "<", "V", ">", "Object", "[", "]", "build", "(", "Iterable", "<", "V", ">", "source", ",", "int", "size", ",", "Comparator", "<", "V", ">", "comparator", ",", "boolean", "sorted", ",", "UpdateFunction", "<", "V", ">", "updateF", "...
Creates a BTree containing all of the objects in the provided collection @param source the items to build the tree with @param comparator the comparator that defines the ordering over the items in the tree @param sorted if false, the collection will be copied and sorted to facilitate construction @param <V> @r...
[ "Creates", "a", "BTree", "containing", "all", "of", "the", "objects", "in", "the", "provided", "collection" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/btree/BTree.java#L96-L132
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/btree/BTree.java
BTree.slice
public static <V> Cursor<V, V> slice(Object[] btree, boolean forwards) { Cursor<V, V> r = new Cursor<>(); r.reset(btree, forwards); return r; }
java
public static <V> Cursor<V, V> slice(Object[] btree, boolean forwards) { Cursor<V, V> r = new Cursor<>(); r.reset(btree, forwards); return r; }
[ "public", "static", "<", "V", ">", "Cursor", "<", "V", ",", "V", ">", "slice", "(", "Object", "[", "]", "btree", ",", "boolean", "forwards", ")", "{", "Cursor", "<", "V", ",", "V", ">", "r", "=", "new", "Cursor", "<>", "(", ")", ";", "r", "."...
Returns an Iterator over the entire tree @param btree the tree to iterate over @param forwards if false, the iterator will start at the end and move backwards @param <V> @return
[ "Returns", "an", "Iterator", "over", "the", "entire", "tree" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/btree/BTree.java#L199-L204
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/btree/BTree.java
BTree.slice
public static <K, V extends K> Cursor<K, V> slice(Object[] btree, Comparator<K> comparator, K start, boolean startInclusive, K end, boolean endInclusive, boolean forwards) { Cursor<K, V> r = new Cursor<>(); r.reset(btree, comparator, start, startInclusive, end, endInclusive, forwards); retur...
java
public static <K, V extends K> Cursor<K, V> slice(Object[] btree, Comparator<K> comparator, K start, boolean startInclusive, K end, boolean endInclusive, boolean forwards) { Cursor<K, V> r = new Cursor<>(); r.reset(btree, comparator, start, startInclusive, end, endInclusive, forwards); retur...
[ "public", "static", "<", "K", ",", "V", "extends", "K", ">", "Cursor", "<", "K", ",", "V", ">", "slice", "(", "Object", "[", "]", "btree", ",", "Comparator", "<", "K", ">", "comparator", ",", "K", "start", ",", "boolean", "startInclusive", ",", "K"...
Returns an Iterator over a sub-range of the tree @param btree the tree to iterate over @param comparator the comparator that defines the ordering over the items in the tree @param start the first item to include @param end the last item to include @param forwards if false, the iterator will start at...
[ "Returns", "an", "Iterator", "over", "a", "sub", "-", "range", "of", "the", "tree" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/btree/BTree.java#L235-L240
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/btree/BTree.java
BTree.getLeafKeyEnd
static int getLeafKeyEnd(Object[] node) { int len = node.length; if (len == 0) return 0; else if (node[len - 1] == null) return len - 1; else return len; }
java
static int getLeafKeyEnd(Object[] node) { int len = node.length; if (len == 0) return 0; else if (node[len - 1] == null) return len - 1; else return len; }
[ "static", "int", "getLeafKeyEnd", "(", "Object", "[", "]", "node", ")", "{", "int", "len", "=", "node", ".", "length", ";", "if", "(", "len", "==", "0", ")", "return", "0", ";", "else", "if", "(", "node", "[", "len", "-", "1", "]", "==", "null"...
get the last index that is non-null in the leaf node
[ "get", "the", "last", "index", "that", "is", "non", "-", "null", "in", "the", "leaf", "node" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/btree/BTree.java#L299-L308
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/btree/BTree.java
BTree.sorted
private static <V> Collection<V> sorted(Iterable<V> source, Comparator<V> comparator, int size) { V[] vs = (V[]) new Object[size]; int i = 0; for (V v : source) vs[i++] = v; Arrays.sort(vs, comparator); return Arrays.asList(vs); }
java
private static <V> Collection<V> sorted(Iterable<V> source, Comparator<V> comparator, int size) { V[] vs = (V[]) new Object[size]; int i = 0; for (V v : source) vs[i++] = v; Arrays.sort(vs, comparator); return Arrays.asList(vs); }
[ "private", "static", "<", "V", ">", "Collection", "<", "V", ">", "sorted", "(", "Iterable", "<", "V", ">", "source", ",", "Comparator", "<", "V", ">", "comparator", ",", "int", "size", ")", "{", "V", "[", "]", "vs", "=", "(", "V", "[", "]", ")"...
return a sorted collection
[ "return", "a", "sorted", "collection" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/btree/BTree.java#L365-L373
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/repair/DatacenterAwareRequestCoordinator.java
DatacenterAwareRequestCoordinator.completed
public int completed(InetAddress request) { String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(request); Queue<InetAddress> requests = requestsByDatacenter.get(dc); assert requests != null; assert request.equals(requests.peek()); requests.poll(); if (!re...
java
public int completed(InetAddress request) { String dc = DatabaseDescriptor.getEndpointSnitch().getDatacenter(request); Queue<InetAddress> requests = requestsByDatacenter.get(dc); assert requests != null; assert request.equals(requests.peek()); requests.poll(); if (!re...
[ "public", "int", "completed", "(", "InetAddress", "request", ")", "{", "String", "dc", "=", "DatabaseDescriptor", ".", "getEndpointSnitch", "(", ")", ".", "getDatacenter", "(", "request", ")", ";", "Queue", "<", "InetAddress", ">", "requests", "=", "requestsBy...
Returns how many request remains
[ "Returns", "how", "many", "request", "remains" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/DatacenterAwareRequestCoordinator.java#L62-L72
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/DataResource.java
DataResource.fromName
public static DataResource fromName(String name) { String[] parts = StringUtils.split(name, '/'); if (!parts[0].equals(ROOT_NAME) || parts.length > 3) throw new IllegalArgumentException(String.format("%s is not a valid data resource name", name)); if (parts.length == 1) ...
java
public static DataResource fromName(String name) { String[] parts = StringUtils.split(name, '/'); if (!parts[0].equals(ROOT_NAME) || parts.length > 3) throw new IllegalArgumentException(String.format("%s is not a valid data resource name", name)); if (parts.length == 1) ...
[ "public", "static", "DataResource", "fromName", "(", "String", "name", ")", "{", "String", "[", "]", "parts", "=", "StringUtils", ".", "split", "(", "name", ",", "'", "'", ")", ";", "if", "(", "!", "parts", "[", "0", "]", ".", "equals", "(", "ROOT_...
Parses a data resource name into a DataResource instance. @param name Name of the data resource. @return DataResource instance matching the name.
[ "Parses", "a", "data", "resource", "name", "into", "a", "DataResource", "instance", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/DataResource.java#L105-L119
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
ColumnFamilyMetrics.createColumnFamilyGauge
protected <T extends Number> Gauge<T> createColumnFamilyGauge(final String name, Gauge<T> gauge) { return createColumnFamilyGauge(name, gauge, new Gauge<Long>() { public Long value() { long total = 0; for (Metric cfGauge : allColumnFamilyMetric...
java
protected <T extends Number> Gauge<T> createColumnFamilyGauge(final String name, Gauge<T> gauge) { return createColumnFamilyGauge(name, gauge, new Gauge<Long>() { public Long value() { long total = 0; for (Metric cfGauge : allColumnFamilyMetric...
[ "protected", "<", "T", "extends", "Number", ">", "Gauge", "<", "T", ">", "createColumnFamilyGauge", "(", "final", "String", "name", ",", "Gauge", "<", "T", ">", "gauge", ")", "{", "return", "createColumnFamilyGauge", "(", "name", ",", "gauge", ",", "new", ...
Create a gauge that will be part of a merged version of all column families. The global gauge will merge each CF gauge by adding their values
[ "Create", "a", "gauge", "that", "will", "be", "part", "of", "a", "merged", "version", "of", "all", "column", "families", ".", "The", "global", "gauge", "will", "merge", "each", "CF", "gauge", "by", "adding", "their", "values" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java#L639-L653
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
ColumnFamilyMetrics.createColumnFamilyGauge
protected <G,T> Gauge<T> createColumnFamilyGauge(String name, Gauge<T> gauge, Gauge<G> globalGauge) { Gauge<T> cfGauge = Metrics.newGauge(factory.createMetricName(name), gauge); if (register(name, cfGauge)) { Metrics.newGauge(globalNameFactory.createMetricName(name), globalGauge)...
java
protected <G,T> Gauge<T> createColumnFamilyGauge(String name, Gauge<T> gauge, Gauge<G> globalGauge) { Gauge<T> cfGauge = Metrics.newGauge(factory.createMetricName(name), gauge); if (register(name, cfGauge)) { Metrics.newGauge(globalNameFactory.createMetricName(name), globalGauge)...
[ "protected", "<", "G", ",", "T", ">", "Gauge", "<", "T", ">", "createColumnFamilyGauge", "(", "String", "name", ",", "Gauge", "<", "T", ">", "gauge", ",", "Gauge", "<", "G", ">", "globalGauge", ")", "{", "Gauge", "<", "T", ">", "cfGauge", "=", "Met...
Create a gauge that will be part of a merged version of all column families. The global gauge is defined as the globalGauge parameter
[ "Create", "a", "gauge", "that", "will", "be", "part", "of", "a", "merged", "version", "of", "all", "column", "families", ".", "The", "global", "gauge", "is", "defined", "as", "the", "globalGauge", "parameter" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java#L659-L667
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
ColumnFamilyMetrics.createColumnFamilyCounter
protected Counter createColumnFamilyCounter(final String name) { Counter cfCounter = Metrics.newCounter(factory.createMetricName(name)); if (register(name, cfCounter)) { Metrics.newGauge(globalNameFactory.createMetricName(name), new Gauge<Long>() { pub...
java
protected Counter createColumnFamilyCounter(final String name) { Counter cfCounter = Metrics.newCounter(factory.createMetricName(name)); if (register(name, cfCounter)) { Metrics.newGauge(globalNameFactory.createMetricName(name), new Gauge<Long>() { pub...
[ "protected", "Counter", "createColumnFamilyCounter", "(", "final", "String", "name", ")", "{", "Counter", "cfCounter", "=", "Metrics", ".", "newCounter", "(", "factory", ".", "createMetricName", "(", "name", ")", ")", ";", "if", "(", "register", "(", "name", ...
Creates a counter that will also have a global counter thats the sum of all counters across different column families
[ "Creates", "a", "counter", "that", "will", "also", "have", "a", "global", "counter", "thats", "the", "sum", "of", "all", "counters", "across", "different", "column", "families" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java#L673-L692
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
ColumnFamilyMetrics.createColumnFamilyHistogram
protected ColumnFamilyHistogram createColumnFamilyHistogram(String name, Histogram keyspaceHistogram) { Histogram cfHistogram = Metrics.newHistogram(factory.createMetricName(name), true); register(name, cfHistogram); return new ColumnFamilyHistogram(cfHistogram, keyspaceHistogram, Metrics...
java
protected ColumnFamilyHistogram createColumnFamilyHistogram(String name, Histogram keyspaceHistogram) { Histogram cfHistogram = Metrics.newHistogram(factory.createMetricName(name), true); register(name, cfHistogram); return new ColumnFamilyHistogram(cfHistogram, keyspaceHistogram, Metrics...
[ "protected", "ColumnFamilyHistogram", "createColumnFamilyHistogram", "(", "String", "name", ",", "Histogram", "keyspaceHistogram", ")", "{", "Histogram", "cfHistogram", "=", "Metrics", ".", "newHistogram", "(", "factory", ".", "createMetricName", "(", "name", ")", ","...
Create a histogram-like interface that will register both a CF, keyspace and global level histogram and forward any updates to both
[ "Create", "a", "histogram", "-", "like", "interface", "that", "will", "register", "both", "a", "CF", "keyspace", "and", "global", "level", "histogram", "and", "forward", "any", "updates", "to", "both" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java#L698-L703
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java
ColumnFamilyMetrics.register
private boolean register(String name, Metric metric) { boolean ret = allColumnFamilyMetrics.putIfAbsent(name, new HashSet<Metric>()) == null; allColumnFamilyMetrics.get(name).add(metric); all.add(name); return ret; }
java
private boolean register(String name, Metric metric) { boolean ret = allColumnFamilyMetrics.putIfAbsent(name, new HashSet<Metric>()) == null; allColumnFamilyMetrics.get(name).add(metric); all.add(name); return ret; }
[ "private", "boolean", "register", "(", "String", "name", ",", "Metric", "metric", ")", "{", "boolean", "ret", "=", "allColumnFamilyMetrics", ".", "putIfAbsent", "(", "name", ",", "new", "HashSet", "<", "Metric", ">", "(", ")", ")", "==", "null", ";", "al...
Registers a metric to be removed when unloading CF. @return true if first time metric with that name has been registered
[ "Registers", "a", "metric", "to", "be", "removed", "when", "unloading", "CF", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/metrics/ColumnFamilyMetrics.java#L709-L715
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/ConfigHelper.java
ConfigHelper.setOutputKeyspace
public static void setOutputKeyspace(Configuration conf, String keyspace) { if (keyspace == null) throw new UnsupportedOperationException("keyspace may not be null"); conf.set(OUTPUT_KEYSPACE_CONFIG, keyspace); }
java
public static void setOutputKeyspace(Configuration conf, String keyspace) { if (keyspace == null) throw new UnsupportedOperationException("keyspace may not be null"); conf.set(OUTPUT_KEYSPACE_CONFIG, keyspace); }
[ "public", "static", "void", "setOutputKeyspace", "(", "Configuration", "conf", ",", "String", "keyspace", ")", "{", "if", "(", "keyspace", "==", "null", ")", "throw", "new", "UnsupportedOperationException", "(", "\"keyspace may not be null\"", ")", ";", "conf", "....
Set the keyspace for the output of this job. @param conf Job configuration you are about to run @param keyspace
[ "Set", "the", "keyspace", "for", "the", "output", "of", "this", "job", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ConfigHelper.java#L114-L120
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/ConfigHelper.java
ConfigHelper.setOutputColumnFamily
public static void setOutputColumnFamily(Configuration conf, String keyspace, String columnFamily) { setOutputKeyspace(conf, keyspace); setOutputColumnFamily(conf, columnFamily); }
java
public static void setOutputColumnFamily(Configuration conf, String keyspace, String columnFamily) { setOutputKeyspace(conf, keyspace); setOutputColumnFamily(conf, columnFamily); }
[ "public", "static", "void", "setOutputColumnFamily", "(", "Configuration", "conf", ",", "String", "keyspace", ",", "String", "columnFamily", ")", "{", "setOutputKeyspace", "(", "conf", ",", "keyspace", ")", ";", "setOutputColumnFamily", "(", "conf", ",", "columnFa...
Set the column family for the output of this job. @param conf Job configuration you are about to run @param keyspace @param columnFamily
[ "Set", "the", "column", "family", "for", "the", "output", "of", "this", "job", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ConfigHelper.java#L140-L144
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/ConfigHelper.java
ConfigHelper.setInputSlicePredicate
public static void setInputSlicePredicate(Configuration conf, SlicePredicate predicate) { conf.set(INPUT_PREDICATE_CONFIG, thriftToString(predicate)); }
java
public static void setInputSlicePredicate(Configuration conf, SlicePredicate predicate) { conf.set(INPUT_PREDICATE_CONFIG, thriftToString(predicate)); }
[ "public", "static", "void", "setInputSlicePredicate", "(", "Configuration", "conf", ",", "SlicePredicate", "predicate", ")", "{", "conf", ".", "set", "(", "INPUT_PREDICATE_CONFIG", ",", "thriftToString", "(", "predicate", ")", ")", ";", "}" ]
Set the predicate that determines what columns will be selected from each row. @param conf Job configuration you are about to run @param predicate
[ "Set", "the", "predicate", "that", "determines", "what", "columns", "will", "be", "selected", "from", "each", "row", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ConfigHelper.java#L198-L201
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/ConfigHelper.java
ConfigHelper.getInputKeyRange
public static KeyRange getInputKeyRange(Configuration conf) { String str = conf.get(INPUT_KEYRANGE_CONFIG); return str == null ? null : keyRangeFromString(str); }
java
public static KeyRange getInputKeyRange(Configuration conf) { String str = conf.get(INPUT_KEYRANGE_CONFIG); return str == null ? null : keyRangeFromString(str); }
[ "public", "static", "KeyRange", "getInputKeyRange", "(", "Configuration", "conf", ")", "{", "String", "str", "=", "conf", ".", "get", "(", "INPUT_KEYRANGE_CONFIG", ")", ";", "return", "str", "==", "null", "?", "null", ":", "keyRangeFromString", "(", "str", "...
may be null if unset
[ "may", "be", "null", "if", "unset" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ConfigHelper.java#L271-L275
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/AtomDeserializer.java
AtomDeserializer.readNext
public OnDiskAtom readNext() throws IOException { Composite name = nameDeserializer.readNext(); assert !name.isEmpty(); // This would imply hasNext() hasn't been called nextFlags = nextFlags == Integer.MIN_VALUE ? in.readUnsignedByte() : nextFlags; OnDiskAtom atom = (nextFlags & Col...
java
public OnDiskAtom readNext() throws IOException { Composite name = nameDeserializer.readNext(); assert !name.isEmpty(); // This would imply hasNext() hasn't been called nextFlags = nextFlags == Integer.MIN_VALUE ? in.readUnsignedByte() : nextFlags; OnDiskAtom atom = (nextFlags & Col...
[ "public", "OnDiskAtom", "readNext", "(", ")", "throws", "IOException", "{", "Composite", "name", "=", "nameDeserializer", ".", "readNext", "(", ")", ";", "assert", "!", "name", ".", "isEmpty", "(", ")", ";", "// This would imply hasNext() hasn't been called", "nex...
Returns the next atom.
[ "Returns", "the", "next", "atom", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/AtomDeserializer.java#L102-L113
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/AtomDeserializer.java
AtomDeserializer.skipNext
public void skipNext() throws IOException { nameDeserializer.skipNext(); nextFlags = nextFlags == Integer.MIN_VALUE ? in.readUnsignedByte() : nextFlags; if ((nextFlags & ColumnSerializer.RANGE_TOMBSTONE_MASK) != 0) type.rangeTombstoneSerializer().skipBody(in, version); el...
java
public void skipNext() throws IOException { nameDeserializer.skipNext(); nextFlags = nextFlags == Integer.MIN_VALUE ? in.readUnsignedByte() : nextFlags; if ((nextFlags & ColumnSerializer.RANGE_TOMBSTONE_MASK) != 0) type.rangeTombstoneSerializer().skipBody(in, version); el...
[ "public", "void", "skipNext", "(", ")", "throws", "IOException", "{", "nameDeserializer", ".", "skipNext", "(", ")", ";", "nextFlags", "=", "nextFlags", "==", "Integer", ".", "MIN_VALUE", "?", "in", ".", "readUnsignedByte", "(", ")", ":", "nextFlags", ";", ...
Skips the next atom.
[ "Skips", "the", "next", "atom", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/AtomDeserializer.java#L118-L127
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/thrift/ThriftSessionManager.java
ThriftSessionManager.connectionComplete
public void connectionComplete(SocketAddress socket) { assert socket != null; activeSocketSessions.remove(socket); if (logger.isTraceEnabled()) logger.trace("ClientState removed for socket addr {}", socket); }
java
public void connectionComplete(SocketAddress socket) { assert socket != null; activeSocketSessions.remove(socket); if (logger.isTraceEnabled()) logger.trace("ClientState removed for socket addr {}", socket); }
[ "public", "void", "connectionComplete", "(", "SocketAddress", "socket", ")", "{", "assert", "socket", "!=", "null", ";", "activeSocketSessions", ".", "remove", "(", "socket", ")", ";", "if", "(", "logger", ".", "isTraceEnabled", "(", ")", ")", "logger", ".",...
The connection associated with @param socket is permanently finished.
[ "The", "connection", "associated", "with" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/ThriftSessionManager.java#L69-L75
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/RowService.java
RowService.delete
public void delete(final DecoratedKey partitionKey) { if (indexQueue == null) { deleteInner(partitionKey); } else { indexQueue.submitAsynchronous(partitionKey, new Runnable() { @Override public void run() { deleteInner(partition...
java
public void delete(final DecoratedKey partitionKey) { if (indexQueue == null) { deleteInner(partitionKey); } else { indexQueue.submitAsynchronous(partitionKey, new Runnable() { @Override public void run() { deleteInner(partition...
[ "public", "void", "delete", "(", "final", "DecoratedKey", "partitionKey", ")", "{", "if", "(", "indexQueue", "==", "null", ")", "{", "deleteInner", "(", "partitionKey", ")", ";", "}", "else", "{", "indexQueue", ".", "submitAsynchronous", "(", "partitionKey", ...
Deletes the partition identified by the specified partition key. This operation is performed asynchronously. @param partitionKey The partition key identifying the partition to be deleted.
[ "Deletes", "the", "partition", "identified", "by", "the", "specified", "partition", "key", ".", "This", "operation", "is", "performed", "asynchronously", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/RowService.java#L165-L176
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/RowService.java
RowService.commit
public final void commit() { if (indexQueue == null) { luceneIndex.commit(); } else { indexQueue.submitSynchronous(new Runnable() { @Override public void run() { luceneIndex.commit(); } }); } ...
java
public final void commit() { if (indexQueue == null) { luceneIndex.commit(); } else { indexQueue.submitSynchronous(new Runnable() { @Override public void run() { luceneIndex.commit(); } }); } ...
[ "public", "final", "void", "commit", "(", ")", "{", "if", "(", "indexQueue", "==", "null", ")", "{", "luceneIndex", ".", "commit", "(", ")", ";", "}", "else", "{", "indexQueue", ".", "submitSynchronous", "(", "new", "Runnable", "(", ")", "{", "@", "O...
Commits the pending changes. This operation is performed asynchronously.
[ "Commits", "the", "pending", "changes", ".", "This", "operation", "is", "performed", "asynchronously", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/RowService.java#L203-L214
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/settings/GroupedOptions.java
GroupedOptions.printOptions
public static void printOptions(PrintStream out, String command, GroupedOptions... groupings) { out.println(); boolean firstRow = true; for (GroupedOptions grouping : groupings) { if (!firstRow) { out.println(" OR "); } ...
java
public static void printOptions(PrintStream out, String command, GroupedOptions... groupings) { out.println(); boolean firstRow = true; for (GroupedOptions grouping : groupings) { if (!firstRow) { out.println(" OR "); } ...
[ "public", "static", "void", "printOptions", "(", "PrintStream", "out", ",", "String", "command", ",", "GroupedOptions", "...", "groupings", ")", "{", "out", ".", "println", "(", ")", ";", "boolean", "firstRow", "=", "true", ";", "for", "(", "GroupedOptions",...
pretty prints all of the option groupings
[ "pretty", "prints", "all", "of", "the", "option", "groupings" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/settings/GroupedOptions.java#L78-L115
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/streaming/messages/StreamInitMessage.java
StreamInitMessage.createMessage
public ByteBuffer createMessage(boolean compress, int version) { int header = 0; // set compression bit. if (compress) header |= 4; // set streaming bit header |= 8; // Setting up the version bit header |= (version << 8); byte[] bytes; ...
java
public ByteBuffer createMessage(boolean compress, int version) { int header = 0; // set compression bit. if (compress) header |= 4; // set streaming bit header |= 8; // Setting up the version bit header |= (version << 8); byte[] bytes; ...
[ "public", "ByteBuffer", "createMessage", "(", "boolean", "compress", ",", "int", "version", ")", "{", "int", "header", "=", "0", ";", "// set compression bit.", "if", "(", "compress", ")", "header", "|=", "4", ";", "// set streaming bit", "header", "|=", "8", ...
Create serialized message. @param compress true if message is compressed @param version Streaming protocol version @return serialized message in ByteBuffer format
[ "Create", "serialized", "message", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/messages/StreamInitMessage.java#L66-L97
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
SSTableRewriter.tryAppend
public RowIndexEntry tryAppend(AbstractCompactedRow row) { writer.mark(); try { return append(row); } catch (Throwable t) { writer.resetAndTruncate(); throw t; } }
java
public RowIndexEntry tryAppend(AbstractCompactedRow row) { writer.mark(); try { return append(row); } catch (Throwable t) { writer.resetAndTruncate(); throw t; } }
[ "public", "RowIndexEntry", "tryAppend", "(", "AbstractCompactedRow", "row", ")", "{", "writer", ".", "mark", "(", ")", ";", "try", "{", "return", "append", "(", "row", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "writer", ".", "resetAndTrunc...
attempts to append the row, if fails resets the writer position
[ "attempts", "to", "append", "the", "row", "if", "fails", "resets", "the", "writer", "position" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java#L146-L158
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
SSTableRewriter.moveStarts
private void moveStarts(SSTableReader newReader, DecoratedKey lowerbound, boolean reset) { if (isOffline) return; List<SSTableReader> toReplace = new ArrayList<>(); List<SSTableReader> replaceWith = new ArrayList<>(); final List<DecoratedKey> invalidateKeys = new ArrayLis...
java
private void moveStarts(SSTableReader newReader, DecoratedKey lowerbound, boolean reset) { if (isOffline) return; List<SSTableReader> toReplace = new ArrayList<>(); List<SSTableReader> replaceWith = new ArrayList<>(); final List<DecoratedKey> invalidateKeys = new ArrayLis...
[ "private", "void", "moveStarts", "(", "SSTableReader", "newReader", ",", "DecoratedKey", "lowerbound", ",", "boolean", "reset", ")", "{", "if", "(", "isOffline", ")", "return", ";", "List", "<", "SSTableReader", ">", "toReplace", "=", "new", "ArrayList", "<>",...
Replace the readers we are rewriting with cloneWithNewStart, reclaiming any page cache that is no longer needed, and transferring any key cache entries over to the new reader, expiring them from the old. if reset is true, we are instead restoring the starts of the readers from before the rewriting began note that we r...
[ "Replace", "the", "readers", "we", "are", "rewriting", "with", "cloneWithNewStart", "reclaiming", "any", "page", "cache", "that", "is", "no", "longer", "needed", "and", "transferring", "any", "key", "cache", "entries", "over", "to", "the", "new", "reader", "ex...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java#L277-L340
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
SSTableRewriter.replaceWithFinishedReaders
private void replaceWithFinishedReaders(List<SSTableReader> finished) { if (isOffline) { for (SSTableReader reader : discard) { if (reader.getCurrentReplacement() == reader) reader.markObsolete(); reader.selfRef().release();...
java
private void replaceWithFinishedReaders(List<SSTableReader> finished) { if (isOffline) { for (SSTableReader reader : discard) { if (reader.getCurrentReplacement() == reader) reader.markObsolete(); reader.selfRef().release();...
[ "private", "void", "replaceWithFinishedReaders", "(", "List", "<", "SSTableReader", ">", "finished", ")", "{", "if", "(", "isOffline", ")", "{", "for", "(", "SSTableReader", "reader", ":", "discard", ")", "{", "if", "(", "reader", ".", "getCurrentReplacement",...
cleanup all our temporary readers and swap in our new ones
[ "cleanup", "all", "our", "temporary", "readers", "and", "swap", "in", "our", "new", "ones" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java#L481-L498
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
CQLSSTableWriter.rawAddRow
public CQLSSTableWriter rawAddRow(ByteBuffer... values) throws InvalidRequestException, IOException { return rawAddRow(Arrays.asList(values)); }
java
public CQLSSTableWriter rawAddRow(ByteBuffer... values) throws InvalidRequestException, IOException { return rawAddRow(Arrays.asList(values)); }
[ "public", "CQLSSTableWriter", "rawAddRow", "(", "ByteBuffer", "...", "values", ")", "throws", "InvalidRequestException", ",", "IOException", "{", "return", "rawAddRow", "(", "Arrays", ".", "asList", "(", "values", ")", ")", ";", "}" ]
Adds a new row to the writer given already serialized values. @param values the row values (corresponding to the bind variables of the insertion statement used when creating by this writer) as binary. @return this writer.
[ "Adds", "a", "new", "row", "to", "the", "writer", "given", "already", "serialized", "values", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java#L186-L190
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java
PendingRangeCalculatorService.calculatePendingRanges
public static void calculatePendingRanges(AbstractReplicationStrategy strategy, String keyspaceName) { TokenMetadata tm = StorageService.instance.getTokenMetadata(); Multimap<Range<Token>, InetAddress> pendingRanges = HashMultimap.create(); BiMultiValMap<Token, InetAddress> bootstrapTokens =...
java
public static void calculatePendingRanges(AbstractReplicationStrategy strategy, String keyspaceName) { TokenMetadata tm = StorageService.instance.getTokenMetadata(); Multimap<Range<Token>, InetAddress> pendingRanges = HashMultimap.create(); BiMultiValMap<Token, InetAddress> bootstrapTokens =...
[ "public", "static", "void", "calculatePendingRanges", "(", "AbstractReplicationStrategy", "strategy", ",", "String", "keyspaceName", ")", "{", "TokenMetadata", "tm", "=", "StorageService", ".", "instance", ".", "getTokenMetadata", "(", ")", ";", "Multimap", "<", "Ra...
public & static for testing purposes
[ "public", "&", "static", "for", "testing", "purposes" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/PendingRangeCalculatorService.java#L118-L193
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java
YamlFileNetworkTopologySnitch.gossiperStarting
@Override public synchronized void gossiperStarting() { gossiperInitialized = true; StorageService.instance.gossipSnitchInfo(); Gossiper.instance.register(new ReconnectableSnitchHelper(this, localNodeData.datacenter, true)); }
java
@Override public synchronized void gossiperStarting() { gossiperInitialized = true; StorageService.instance.gossipSnitchInfo(); Gossiper.instance.register(new ReconnectableSnitchHelper(this, localNodeData.datacenter, true)); }
[ "@", "Override", "public", "synchronized", "void", "gossiperStarting", "(", ")", "{", "gossiperInitialized", "=", "true", ";", "StorageService", ".", "instance", ".", "gossipSnitchInfo", "(", ")", ";", "Gossiper", ".", "instance", ".", "register", "(", "new", ...
Called in preparation for the initiation of the gossip loop.
[ "Called", "in", "preparation", "for", "the", "initiation", "of", "the", "gossip", "loop", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/YamlFileNetworkTopologySnitch.java#L407-L413
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/streaming/StreamTransferTask.java
StreamTransferTask.scheduleTimeout
public synchronized ScheduledFuture scheduleTimeout(final int sequenceNumber, long time, TimeUnit unit) { if (!files.containsKey(sequenceNumber)) return null; ScheduledFuture future = timeoutExecutor.schedule(new Runnable() { public void run() { ...
java
public synchronized ScheduledFuture scheduleTimeout(final int sequenceNumber, long time, TimeUnit unit) { if (!files.containsKey(sequenceNumber)) return null; ScheduledFuture future = timeoutExecutor.schedule(new Runnable() { public void run() { ...
[ "public", "synchronized", "ScheduledFuture", "scheduleTimeout", "(", "final", "int", "sequenceNumber", ",", "long", "time", ",", "TimeUnit", "unit", ")", "{", "if", "(", "!", "files", ".", "containsKey", "(", "sequenceNumber", ")", ")", "return", "null", ";", ...
Schedule timeout task to release reference for file sent. When not receiving ACK after sending to receiver in given time, the task will release reference. @param sequenceNumber sequence number of file sent. @param time time to timeout @param unit unit of given time @return scheduled future for timeout task
[ "Schedule", "timeout", "task", "to", "release", "reference", "for", "file", "sent", ".", "When", "not", "receiving", "ACK", "after", "sending", "to", "receiver", "in", "given", "time", "the", "task", "will", "release", "reference", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/StreamTransferTask.java#L153-L174
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/RangeTombstoneList.java
RangeTombstoneList.add
public void add(Composite start, Composite end, long markedAt, int delTime) { if (isEmpty()) { addInternal(0, start, end, markedAt, delTime); return; } int c = comparator.compare(ends[size-1], start); // Fast path if we add in sorted order if...
java
public void add(Composite start, Composite end, long markedAt, int delTime) { if (isEmpty()) { addInternal(0, start, end, markedAt, delTime); return; } int c = comparator.compare(ends[size-1], start); // Fast path if we add in sorted order if...
[ "public", "void", "add", "(", "Composite", "start", ",", "Composite", "end", ",", "long", "markedAt", ",", "int", "delTime", ")", "{", "if", "(", "isEmpty", "(", ")", ")", "{", "addInternal", "(", "0", ",", "start", ",", "end", ",", "markedAt", ",", ...
Adds a new range tombstone. This method will be faster if the new tombstone sort after all the currently existing ones (this is a common use case), but it doesn't assume it.
[ "Adds", "a", "new", "range", "tombstone", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/RangeTombstoneList.java#L152-L174
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/RangeTombstoneList.java
RangeTombstoneList.purge
public void purge(int gcBefore) { int j = 0; for (int i = 0; i < size; i++) { if (delTimes[i] >= gcBefore) setInternal(j++, starts[i], ends[i], markedAts[i], delTimes[i]); } size = j; }
java
public void purge(int gcBefore) { int j = 0; for (int i = 0; i < size; i++) { if (delTimes[i] >= gcBefore) setInternal(j++, starts[i], ends[i], markedAts[i], delTimes[i]); } size = j; }
[ "public", "void", "purge", "(", "int", "gcBefore", ")", "{", "int", "j", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "if", "(", "delTimes", "[", "i", "]", ">=", "gcBefore", ")", "setIntern...
Removes all range tombstones whose local deletion time is older than gcBefore.
[ "Removes", "all", "range", "tombstones", "whose", "local", "deletion", "time", "is", "older", "than", "gcBefore", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/RangeTombstoneList.java#L337-L346
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/RangeTombstoneList.java
RangeTombstoneList.updateDigest
public void updateDigest(MessageDigest digest) { ByteBuffer longBuffer = ByteBuffer.allocate(8); for (int i = 0; i < size; i++) { for (int j = 0; j < starts[i].size(); j++) digest.update(starts[i].get(j).duplicate()); for (int j = 0; j < ends[i].size()...
java
public void updateDigest(MessageDigest digest) { ByteBuffer longBuffer = ByteBuffer.allocate(8); for (int i = 0; i < size; i++) { for (int j = 0; j < starts[i].size(); j++) digest.update(starts[i].get(j).duplicate()); for (int j = 0; j < ends[i].size()...
[ "public", "void", "updateDigest", "(", "MessageDigest", "digest", ")", "{", "ByteBuffer", "longBuffer", "=", "ByteBuffer", ".", "allocate", "(", "8", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "for", ...
Calculates digest for triggering read repair on mismatch
[ "Calculates", "digest", "for", "triggering", "read", "repair", "on", "mismatch" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/RangeTombstoneList.java#L464-L477
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/BloomFilter.java
BloomFilter.getHashBuckets
@VisibleForTesting public long[] getHashBuckets(ByteBuffer key, int hashCount, long max) { long[] hash = new long[2]; hash(key, key.position(), key.remaining(), 0L, hash); long[] indexes = new long[hashCount]; setIndexes(hash[0], hash[1], hashCount, max, indexes); return ...
java
@VisibleForTesting public long[] getHashBuckets(ByteBuffer key, int hashCount, long max) { long[] hash = new long[2]; hash(key, key.position(), key.remaining(), 0L, hash); long[] indexes = new long[hashCount]; setIndexes(hash[0], hash[1], hashCount, max, indexes); return ...
[ "@", "VisibleForTesting", "public", "long", "[", "]", "getHashBuckets", "(", "ByteBuffer", "key", ",", "int", "hashCount", ",", "long", "max", ")", "{", "long", "[", "]", "hash", "=", "new", "long", "[", "2", "]", ";", "hash", "(", "key", ",", "key",...
rather than using the threadLocal like we do in production
[ "rather", "than", "using", "the", "threadLocal", "like", "we", "do", "in", "production" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/BloomFilter.java#L63-L71
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/BloomFilter.java
BloomFilter.indexes
private long[] indexes(ByteBuffer key) { // we use the same array both for storing the hash result, and for storing the indexes we return, // so that we do not need to allocate two arrays. long[] indexes = reusableIndexes.get(); hash(key, key.position(), key.remaining(), 0L, indexes)...
java
private long[] indexes(ByteBuffer key) { // we use the same array both for storing the hash result, and for storing the indexes we return, // so that we do not need to allocate two arrays. long[] indexes = reusableIndexes.get(); hash(key, key.position(), key.remaining(), 0L, indexes)...
[ "private", "long", "[", "]", "indexes", "(", "ByteBuffer", "key", ")", "{", "// we use the same array both for storing the hash result, and for storing the indexes we return,", "// so that we do not need to allocate two arrays.", "long", "[", "]", "indexes", "=", "reusableIndexes",...
a second threadlocal lookup.
[ "a", "second", "threadlocal", "lookup", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/BloomFilter.java#L77-L85
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java
ClusteringKeyMapper.addFields
public final void addFields(Document document, CellName cellName) { String serializedKey = ByteBufferUtils.toString(cellName.toByteBuffer()); Field field = new StringField(FIELD_NAME, serializedKey, Field.Store.YES); document.add(field); }
java
public final void addFields(Document document, CellName cellName) { String serializedKey = ByteBufferUtils.toString(cellName.toByteBuffer()); Field field = new StringField(FIELD_NAME, serializedKey, Field.Store.YES); document.add(field); }
[ "public", "final", "void", "addFields", "(", "Document", "document", ",", "CellName", "cellName", ")", "{", "String", "serializedKey", "=", "ByteBufferUtils", ".", "toString", "(", "cellName", ".", "toByteBuffer", "(", ")", ")", ";", "Field", "field", "=", "...
Adds to the specified document the clustering key contained in the specified cell name. @param document The document where the clustering key is going to be added. @param cellName A cell name containing the clustering key to be added.
[ "Adds", "to", "the", "specified", "document", "the", "clustering", "key", "contained", "in", "the", "specified", "cell", "name", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java#L110-L114
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java
ClusteringKeyMapper.clusteringKeys
public final List<CellName> clusteringKeys(ColumnFamily columnFamily) { List<CellName> clusteringKeys = new ArrayList<>(); CellName lastClusteringKey = null; for (Cell cell : columnFamily) { CellName cellName = cell.name(); if (!isStatic(cellName)) { CellN...
java
public final List<CellName> clusteringKeys(ColumnFamily columnFamily) { List<CellName> clusteringKeys = new ArrayList<>(); CellName lastClusteringKey = null; for (Cell cell : columnFamily) { CellName cellName = cell.name(); if (!isStatic(cellName)) { CellN...
[ "public", "final", "List", "<", "CellName", ">", "clusteringKeys", "(", "ColumnFamily", "columnFamily", ")", "{", "List", "<", "CellName", ">", "clusteringKeys", "=", "new", "ArrayList", "<>", "(", ")", ";", "CellName", "lastClusteringKey", "=", "null", ";", ...
Returns the common clustering keys of the specified column family. @param columnFamily A storage engine {@link ColumnFamily}. @return The common clustering keys of the specified column family.
[ "Returns", "the", "common", "clustering", "keys", "of", "the", "specified", "column", "family", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java#L134-L148
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java
ClusteringKeyMapper.makeCellName
public final CellName makeCellName(CellName cellName, ColumnDefinition columnDefinition) { return cellNameType.create(start(cellName), columnDefinition); }
java
public final CellName makeCellName(CellName cellName, ColumnDefinition columnDefinition) { return cellNameType.create(start(cellName), columnDefinition); }
[ "public", "final", "CellName", "makeCellName", "(", "CellName", "cellName", ",", "ColumnDefinition", "columnDefinition", ")", "{", "return", "cellNameType", ".", "create", "(", "start", "(", "cellName", ")", ",", "columnDefinition", ")", ";", "}" ]
Returns the storage engine column name for the specified column identifier using the specified clustering key. @param cellName The clustering key. @param columnDefinition The column definition. @return A storage engine column name.
[ "Returns", "the", "storage", "engine", "column", "name", "for", "the", "specified", "column", "identifier", "using", "the", "specified", "clustering", "key", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java#L177-L179
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java
ClusteringKeyMapper.clusteringKey
public final CellName clusteringKey(BytesRef bytesRef) { String string = bytesRef.utf8ToString(); ByteBuffer bb = ByteBufferUtils.fromString(string); return cellNameType.cellFromByteBuffer(bb); }
java
public final CellName clusteringKey(BytesRef bytesRef) { String string = bytesRef.utf8ToString(); ByteBuffer bb = ByteBufferUtils.fromString(string); return cellNameType.cellFromByteBuffer(bb); }
[ "public", "final", "CellName", "clusteringKey", "(", "BytesRef", "bytesRef", ")", "{", "String", "string", "=", "bytesRef", ".", "utf8ToString", "(", ")", ";", "ByteBuffer", "bb", "=", "ByteBufferUtils", ".", "fromString", "(", "string", ")", ";", "return", ...
Returns the clustering key contained in the specified Lucene field value. @param bytesRef The {@link BytesRef} containing the raw clustering key to be get. @return The clustering key contained in the specified Lucene field value.
[ "Returns", "the", "clustering", "key", "contained", "in", "the", "specified", "Lucene", "field", "value", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java#L209-L213
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java
ClusteringKeyMapper.start
public final Composite start(CellName cellName) { CBuilder builder = cellNameType.builder(); for (int i = 0; i < cellName.clusteringSize(); i++) { ByteBuffer component = cellName.get(i); builder.add(component); } return builder.build(); }
java
public final Composite start(CellName cellName) { CBuilder builder = cellNameType.builder(); for (int i = 0; i < cellName.clusteringSize(); i++) { ByteBuffer component = cellName.get(i); builder.add(component); } return builder.build(); }
[ "public", "final", "Composite", "start", "(", "CellName", "cellName", ")", "{", "CBuilder", "builder", "=", "cellNameType", ".", "builder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cellName", ".", "clusteringSize", "(", ")", ";"...
Returns the first possible cell name of those having the same clustering key that the specified cell name. @param cellName A storage engine cell name. @return The first column name of for {@code clusteringKey}.
[ "Returns", "the", "first", "possible", "cell", "name", "of", "those", "having", "the", "same", "clustering", "key", "that", "the", "specified", "cell", "name", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java#L237-L244
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java
ClusteringKeyMapper.end
public final Composite end(CellName cellName) { return start(cellName).withEOC(Composite.EOC.END); }
java
public final Composite end(CellName cellName) { return start(cellName).withEOC(Composite.EOC.END); }
[ "public", "final", "Composite", "end", "(", "CellName", "cellName", ")", "{", "return", "start", "(", "cellName", ")", ".", "withEOC", "(", "Composite", ".", "EOC", ".", "END", ")", ";", "}" ]
Returns the last possible cell name of those having the same clustering key that the specified cell name. @param cellName A storage engine cell name. @return The first column name of for {@code clusteringKey}.
[ "Returns", "the", "last", "possible", "cell", "name", "of", "those", "having", "the", "same", "clustering", "key", "that", "the", "specified", "cell", "name", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java#L252-L254
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java
ClusteringKeyMapper.sort
public final List<CellName> sort(List<CellName> clusteringKeys) { List<CellName> result = new ArrayList<>(clusteringKeys); Collections.sort(result, new Comparator<CellName>() { @Override public int compare(CellName o1, CellName o2) { return cellNameType.compare(o1...
java
public final List<CellName> sort(List<CellName> clusteringKeys) { List<CellName> result = new ArrayList<>(clusteringKeys); Collections.sort(result, new Comparator<CellName>() { @Override public int compare(CellName o1, CellName o2) { return cellNameType.compare(o1...
[ "public", "final", "List", "<", "CellName", ">", "sort", "(", "List", "<", "CellName", ">", "clusteringKeys", ")", "{", "List", "<", "CellName", ">", "result", "=", "new", "ArrayList", "<>", "(", "clusteringKeys", ")", ";", "Collections", ".", "sort", "(...
Returns the specified list of clustering keys sorted according to the table cell name comparator. @param clusteringKeys The list of clustering keys to be sorted. @return The specified list of clustering keys sorted according to the table cell name comparator.
[ "Returns", "the", "specified", "list", "of", "clustering", "keys", "sorted", "according", "to", "the", "table", "cell", "name", "comparator", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/service/ClusteringKeyMapper.java#L310-L319
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/SnitchProperties.java
SnitchProperties.get
public String get(String propertyName, String defaultValue) { return properties.getProperty(propertyName, defaultValue); }
java
public String get(String propertyName, String defaultValue) { return properties.getProperty(propertyName, defaultValue); }
[ "public", "String", "get", "(", "String", "propertyName", ",", "String", "defaultValue", ")", "{", "return", "properties", ".", "getProperty", "(", "propertyName", ",", "defaultValue", ")", ";", "}" ]
Get a snitch property value or return defaultValue if not defined.
[ "Get", "a", "snitch", "property", "value", "or", "return", "defaultValue", "if", "not", "defined", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/SnitchProperties.java#L65-L68
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/marshal/TypeParser.java
TypeParser.parse
public static AbstractType<?> parse(String str) throws SyntaxException, ConfigurationException { if (str == null) return BytesType.instance; AbstractType<?> type = cache.get(str); if (type != null) return type; // This could be simplier (i.e. new TypeParser...
java
public static AbstractType<?> parse(String str) throws SyntaxException, ConfigurationException { if (str == null) return BytesType.instance; AbstractType<?> type = cache.get(str); if (type != null) return type; // This could be simplier (i.e. new TypeParser...
[ "public", "static", "AbstractType", "<", "?", ">", "parse", "(", "String", "str", ")", "throws", "SyntaxException", ",", "ConfigurationException", "{", "if", "(", "str", "==", "null", ")", "return", "BytesType", ".", "instance", ";", "AbstractType", "<", "?"...
Parse a string containing an type definition.
[ "Parse", "a", "string", "containing", "an", "type", "definition", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/TypeParser.java#L64-L95
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/marshal/TypeParser.java
TypeParser.parse
public AbstractType<?> parse() throws SyntaxException, ConfigurationException { skipBlank(); String name = readNextIdentifier(); skipBlank(); if (!isEOS() && str.charAt(idx) == '(') return getAbstractType(name, this); else return getAbstractType(name)...
java
public AbstractType<?> parse() throws SyntaxException, ConfigurationException { skipBlank(); String name = readNextIdentifier(); skipBlank(); if (!isEOS() && str.charAt(idx) == '(') return getAbstractType(name, this); else return getAbstractType(name)...
[ "public", "AbstractType", "<", "?", ">", "parse", "(", ")", "throws", "SyntaxException", ",", "ConfigurationException", "{", "skipBlank", "(", ")", ";", "String", "name", "=", "readNextIdentifier", "(", ")", ";", "skipBlank", "(", ")", ";", "if", "(", "!",...
Parse an AbstractType from current position of this parser.
[ "Parse", "an", "AbstractType", "from", "current", "position", "of", "this", "parser", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/TypeParser.java#L110-L120
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/marshal/TypeParser.java
TypeParser.skipBlankAndComma
private boolean skipBlankAndComma() { boolean commaFound = false; while (!isEOS()) { int c = str.charAt(idx); if (c == ',') { if (commaFound) return true; else commaFound = true; ...
java
private boolean skipBlankAndComma() { boolean commaFound = false; while (!isEOS()) { int c = str.charAt(idx); if (c == ',') { if (commaFound) return true; else commaFound = true; ...
[ "private", "boolean", "skipBlankAndComma", "(", ")", "{", "boolean", "commaFound", "=", "false", ";", "while", "(", "!", "isEOS", "(", ")", ")", "{", "int", "c", "=", "str", ".", "charAt", "(", "idx", ")", ";", "if", "(", "c", "==", "'", "'", ")"...
skip all blank and at best one comma, return true if there not EOS
[ "skip", "all", "blank", "and", "at", "best", "one", "comma", "return", "true", "if", "there", "not", "EOS" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/TypeParser.java#L467-L487
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/marshal/TypeParser.java
TypeParser.readNextIdentifier
public String readNextIdentifier() { int i = idx; while (!isEOS() && isIdentifierChar(str.charAt(idx))) ++idx; return str.substring(i, idx); }
java
public String readNextIdentifier() { int i = idx; while (!isEOS() && isIdentifierChar(str.charAt(idx))) ++idx; return str.substring(i, idx); }
[ "public", "String", "readNextIdentifier", "(", ")", "{", "int", "i", "=", "idx", ";", "while", "(", "!", "isEOS", "(", ")", "&&", "isIdentifierChar", "(", "str", ".", "charAt", "(", "idx", ")", ")", ")", "++", "idx", ";", "return", "str", ".", "sub...
left idx positioned on the character stopping the read
[ "left", "idx", "positioned", "on", "the", "character", "stopping", "the", "read" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/TypeParser.java#L500-L507
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java
CompressedSequentialWriter.seekToChunkStart
private void seekToChunkStart() { if (getOnDiskFilePointer() != chunkOffset) { try { out.seek(chunkOffset); } catch (IOException e) { throw new FSReadError(e, getPath()); } } }
java
private void seekToChunkStart() { if (getOnDiskFilePointer() != chunkOffset) { try { out.seek(chunkOffset); } catch (IOException e) { throw new FSReadError(e, getPath()); } } }
[ "private", "void", "seekToChunkStart", "(", ")", "{", "if", "(", "getOnDiskFilePointer", "(", ")", "!=", "chunkOffset", ")", "{", "try", "{", "out", ".", "seek", "(", "chunkOffset", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "n...
Seek to the offset where next compressed data chunk should be stored.
[ "Seek", "to", "the", "offset", "where", "next", "compressed", "data", "chunk", "should", "be", "stored", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/compress/CompressedSequentialWriter.java#L243-L256
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/index/schema/mapping/Mapping.java
Mapping.validate
public void validate(CFMetaData metadata) { for (Map.Entry<String, ColumnMapper> entry : columnMappers.entrySet()) { String name = entry.getKey(); ColumnMapper columnMapper = entry.getValue(); ByteBuffer columnName = UTF8Type.instance.decompose(name); ColumnDefi...
java
public void validate(CFMetaData metadata) { for (Map.Entry<String, ColumnMapper> entry : columnMappers.entrySet()) { String name = entry.getKey(); ColumnMapper columnMapper = entry.getValue(); ByteBuffer columnName = UTF8Type.instance.decompose(name); ColumnDefi...
[ "public", "void", "validate", "(", "CFMetaData", "metadata", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "ColumnMapper", ">", "entry", ":", "columnMappers", ".", "entrySet", "(", ")", ")", "{", "String", "name", "=", "entry", ".", "g...
Checks if this is consistent with the specified column family metadata. @param metadata A column family metadata.
[ "Checks", "if", "this", "is", "consistent", "with", "the", "specified", "column", "family", "metadata", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/schema/mapping/Mapping.java#L50-L71
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.reload
public void reload() { // figure out what needs to be added and dropped. // future: if/when we have modifiable settings for secondary indexes, // they'll need to be handled here. Collection<ByteBuffer> indexedColumnNames = indexesByColumn.keySet(); for (ByteBuffer indexedColu...
java
public void reload() { // figure out what needs to be added and dropped. // future: if/when we have modifiable settings for secondary indexes, // they'll need to be handled here. Collection<ByteBuffer> indexedColumnNames = indexesByColumn.keySet(); for (ByteBuffer indexedColu...
[ "public", "void", "reload", "(", ")", "{", "// figure out what needs to be added and dropped.", "// future: if/when we have modifiable settings for secondary indexes,", "// they'll need to be handled here.", "Collection", "<", "ByteBuffer", ">", "indexedColumnNames", "=", "indexesByCol...
Drops and adds new indexes associated with the underlying CF
[ "Drops", "and", "adds", "new", "indexes", "associated", "with", "the", "underlying", "CF" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L118-L138
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.maybeBuildSecondaryIndexes
public void maybeBuildSecondaryIndexes(Collection<SSTableReader> sstables, Set<String> idxNames) { if (idxNames.isEmpty()) return; logger.info(String.format("Submitting index build of %s for data in %s", idxNames, StringUtils.join(sstables, ", "))); ...
java
public void maybeBuildSecondaryIndexes(Collection<SSTableReader> sstables, Set<String> idxNames) { if (idxNames.isEmpty()) return; logger.info(String.format("Submitting index build of %s for data in %s", idxNames, StringUtils.join(sstables, ", "))); ...
[ "public", "void", "maybeBuildSecondaryIndexes", "(", "Collection", "<", "SSTableReader", ">", "sstables", ",", "Set", "<", "String", ">", "idxNames", ")", "{", "if", "(", "idxNames", ".", "isEmpty", "(", ")", ")", "return", ";", "logger", ".", "info", "(",...
Does a full, blocking rebuild of the indexes specified by columns from the sstables. Does nothing if columns is empty. Caller must acquire and release references to the sstables used here. @param sstables the data to build from @param idxNames the list of columns to index, ordered by comparator
[ "Does", "a", "full", "blocking", "rebuild", "of", "the", "indexes", "specified", "by", "columns", "from", "the", "sstables", ".", "Does", "nothing", "if", "columns", "is", "empty", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L157-L172
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.removeIndexedColumn
public void removeIndexedColumn(ByteBuffer column) { SecondaryIndex index = indexesByColumn.remove(column); if (index == null) return; // Remove this column from from row level index map as well as all indexes set if (index instanceof PerRowSecondaryIndex) { ...
java
public void removeIndexedColumn(ByteBuffer column) { SecondaryIndex index = indexesByColumn.remove(column); if (index == null) return; // Remove this column from from row level index map as well as all indexes set if (index instanceof PerRowSecondaryIndex) { ...
[ "public", "void", "removeIndexedColumn", "(", "ByteBuffer", "column", ")", "{", "SecondaryIndex", "index", "=", "indexesByColumn", ".", "remove", "(", "column", ")", ";", "if", "(", "index", "==", "null", ")", "return", ";", "// Remove this column from from row le...
Removes a existing index @param column the indexed column to remove
[ "Removes", "a", "existing", "index" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L237-L263
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.addIndexedColumn
public synchronized Future<?> addIndexedColumn(ColumnDefinition cdef) { if (indexesByColumn.containsKey(cdef.name.bytes)) return null; assert cdef.getIndexType() != null; SecondaryIndex index; try { index = SecondaryIndex.createInstance(baseCfs, cdef...
java
public synchronized Future<?> addIndexedColumn(ColumnDefinition cdef) { if (indexesByColumn.containsKey(cdef.name.bytes)) return null; assert cdef.getIndexType() != null; SecondaryIndex index; try { index = SecondaryIndex.createInstance(baseCfs, cdef...
[ "public", "synchronized", "Future", "<", "?", ">", "addIndexedColumn", "(", "ColumnDefinition", "cdef", ")", "{", "if", "(", "indexesByColumn", ".", "containsKey", "(", "cdef", ".", "name", ".", "bytes", ")", ")", "return", "null", ";", "assert", "cdef", "...
Adds and builds a index for a column @param cdef the column definition holding the index data @return a future which the caller can optionally block on signaling the index is built
[ "Adds", "and", "builds", "a", "index", "for", "a", "column" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L270-L329
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.flushIndexesBlocking
public void flushIndexesBlocking() { // despatch flushes for all CFS backed indexes List<Future<?>> wait = new ArrayList<>(); synchronized (baseCfs.getDataTracker()) { for (SecondaryIndex index : allIndexes) if (index.getIndexCfs() != null) ...
java
public void flushIndexesBlocking() { // despatch flushes for all CFS backed indexes List<Future<?>> wait = new ArrayList<>(); synchronized (baseCfs.getDataTracker()) { for (SecondaryIndex index : allIndexes) if (index.getIndexCfs() != null) ...
[ "public", "void", "flushIndexesBlocking", "(", ")", "{", "// despatch flushes for all CFS backed indexes", "List", "<", "Future", "<", "?", ">", ">", "wait", "=", "new", "ArrayList", "<>", "(", ")", ";", "synchronized", "(", "baseCfs", ".", "getDataTracker", "("...
Flush all indexes to disk
[ "Flush", "all", "indexes", "to", "disk" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L353-L371
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.indexRow
public void indexRow(ByteBuffer key, ColumnFamily cf, OpOrder.Group opGroup) { // Update entire row only once per row level index Set<Class<? extends SecondaryIndex>> appliedRowLevelIndexes = null; for (SecondaryIndex index : allIndexes) { if (index instanceof PerRowSeco...
java
public void indexRow(ByteBuffer key, ColumnFamily cf, OpOrder.Group opGroup) { // Update entire row only once per row level index Set<Class<? extends SecondaryIndex>> appliedRowLevelIndexes = null; for (SecondaryIndex index : allIndexes) { if (index instanceof PerRowSeco...
[ "public", "void", "indexRow", "(", "ByteBuffer", "key", ",", "ColumnFamily", "cf", ",", "OpOrder", ".", "Group", "opGroup", ")", "{", "// Update entire row only once per row level index", "Set", "<", "Class", "<", "?", "extends", "SecondaryIndex", ">", ">", "appli...
When building an index against existing data, add the given row to the index @param key the row key @param cf the current rows data
[ "When", "building", "an", "index", "against", "existing", "data", "add", "the", "given", "row", "to", "the", "index" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L443-L465
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.deleteFromIndexes
public void deleteFromIndexes(DecoratedKey key, List<Cell> indexedColumnsInRow, OpOrder.Group opGroup) { // Update entire row only once per row level index Set<Class<? extends SecondaryIndex>> cleanedRowLevelIndexes = null; for (Cell cell : indexedColumnsInRow) { for (Se...
java
public void deleteFromIndexes(DecoratedKey key, List<Cell> indexedColumnsInRow, OpOrder.Group opGroup) { // Update entire row only once per row level index Set<Class<? extends SecondaryIndex>> cleanedRowLevelIndexes = null; for (Cell cell : indexedColumnsInRow) { for (Se...
[ "public", "void", "deleteFromIndexes", "(", "DecoratedKey", "key", ",", "List", "<", "Cell", ">", "indexedColumnsInRow", ",", "OpOrder", ".", "Group", "opGroup", ")", "{", "// Update entire row only once per row level index", "Set", "<", "Class", "<", "?", "extends"...
Delete all columns from all indexes for this row. For when cleanup rips a row out entirely. @param key the row key @param indexedColumnsInRow all column names in row
[ "Delete", "all", "columns", "from", "all", "indexes", "for", "this", "row", ".", "For", "when", "cleanup", "rips", "a", "row", "out", "entirely", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L473-L495
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.getIndexSearchersForQuery
public List<SecondaryIndexSearcher> getIndexSearchersForQuery(List<IndexExpression> clause) { Map<String, Set<ByteBuffer>> groupByIndexType = new HashMap<>(); //Group columns by type for (IndexExpression ix : clause) { SecondaryIndex index = getIndexForColumn(ix.column);...
java
public List<SecondaryIndexSearcher> getIndexSearchersForQuery(List<IndexExpression> clause) { Map<String, Set<ByteBuffer>> groupByIndexType = new HashMap<>(); //Group columns by type for (IndexExpression ix : clause) { SecondaryIndex index = getIndexForColumn(ix.column);...
[ "public", "List", "<", "SecondaryIndexSearcher", ">", "getIndexSearchersForQuery", "(", "List", "<", "IndexExpression", ">", "clause", ")", "{", "Map", "<", "String", ",", "Set", "<", "ByteBuffer", ">", ">", "groupByIndexType", "=", "new", "HashMap", "<>", "("...
Get a list of IndexSearchers from the union of expression index types @param clause the query clause @return the searchers needed to query the index
[ "Get", "a", "list", "of", "IndexSearchers", "from", "the", "union", "of", "expression", "index", "types" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L524-L554
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java
SecondaryIndexManager.search
public List<Row> search(ExtendedFilter filter) { SecondaryIndexSearcher mostSelective = getHighestSelectivityIndexSearcher(filter.getClause()); if (mostSelective == null) return Collections.emptyList(); else return mostSelective.search(filter); }
java
public List<Row> search(ExtendedFilter filter) { SecondaryIndexSearcher mostSelective = getHighestSelectivityIndexSearcher(filter.getClause()); if (mostSelective == null) return Collections.emptyList(); else return mostSelective.search(filter); }
[ "public", "List", "<", "Row", ">", "search", "(", "ExtendedFilter", "filter", ")", "{", "SecondaryIndexSearcher", "mostSelective", "=", "getHighestSelectivityIndexSearcher", "(", "filter", ".", "getClause", "(", ")", ")", ";", "if", "(", "mostSelective", "==", "...
Performs a search across a number of column indexes @param filter the column range to restrict to @return found indexed rows
[ "Performs", "a", "search", "across", "a", "number", "of", "column", "indexes" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexManager.java#L638-L645
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/ColumnFamilySplit.java
ColumnFamilySplit.write
public void write(DataOutput out) throws IOException { out.writeUTF(startToken); out.writeUTF(endToken); out.writeInt(dataNodes.length); for (String endpoint : dataNodes) { out.writeUTF(endpoint); } }
java
public void write(DataOutput out) throws IOException { out.writeUTF(startToken); out.writeUTF(endToken); out.writeInt(dataNodes.length); for (String endpoint : dataNodes) { out.writeUTF(endpoint); } }
[ "public", "void", "write", "(", "DataOutput", "out", ")", "throws", "IOException", "{", "out", ".", "writeUTF", "(", "startToken", ")", ";", "out", ".", "writeUTF", "(", "endToken", ")", ";", "out", ".", "writeInt", "(", "dataNodes", ".", "length", ")", ...
KeyspaceSplits as needed by the Writable interface.
[ "KeyspaceSplits", "as", "needed", "by", "the", "Writable", "interface", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ColumnFamilySplit.java#L78-L87
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/concurrent/DebuggableScheduledThreadPoolExecutor.java
DebuggableScheduledThreadPoolExecutor.afterExecute
@Override public void afterExecute(Runnable r, Throwable t) { super.afterExecute(r,t); DebuggableThreadPoolExecutor.logExceptionsAfterExecute(r, t); }
java
@Override public void afterExecute(Runnable r, Throwable t) { super.afterExecute(r,t); DebuggableThreadPoolExecutor.logExceptionsAfterExecute(r, t); }
[ "@", "Override", "public", "void", "afterExecute", "(", "Runnable", "r", ",", "Throwable", "t", ")", "{", "super", ".", "afterExecute", "(", "r", ",", "t", ")", ";", "DebuggableThreadPoolExecutor", ".", "logExceptionsAfterExecute", "(", "r", ",", "t", ")", ...
We need this as well as the wrapper for the benefit of non-repeating tasks
[ "We", "need", "this", "as", "well", "as", "the", "wrapper", "for", "the", "benefit", "of", "non", "-", "repeating", "tasks" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/DebuggableScheduledThreadPoolExecutor.java#L49-L54
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Directories.java
Directories.snapshotCreationTime
public long snapshotCreationTime(String snapshotName) { for (File dir : dataPaths) { File snapshotDir = new File(dir, join(SNAPSHOT_SUBDIR, snapshotName)); if (snapshotDir.exists()) return snapshotDir.lastModified(); } throw new RuntimeExceptio...
java
public long snapshotCreationTime(String snapshotName) { for (File dir : dataPaths) { File snapshotDir = new File(dir, join(SNAPSHOT_SUBDIR, snapshotName)); if (snapshotDir.exists()) return snapshotDir.lastModified(); } throw new RuntimeExceptio...
[ "public", "long", "snapshotCreationTime", "(", "String", "snapshotName", ")", "{", "for", "(", "File", "dir", ":", "dataPaths", ")", "{", "File", "snapshotDir", "=", "new", "File", "(", "dir", ",", "join", "(", "SNAPSHOT_SUBDIR", ",", "snapshotName", ")", ...
The snapshot must exist
[ "The", "snapshot", "must", "exist" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Directories.java#L622-L631
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Directories.java
Directories.getKSChildDirectories
public static List<File> getKSChildDirectories(String ksName) { List<File> result = new ArrayList<>(); for (DataDirectory dataDirectory : dataDirectories) { File ksDir = new File(dataDirectory.location, ksName); File[] cfDirs = ksDir.listFiles(); if (cfDir...
java
public static List<File> getKSChildDirectories(String ksName) { List<File> result = new ArrayList<>(); for (DataDirectory dataDirectory : dataDirectories) { File ksDir = new File(dataDirectory.location, ksName); File[] cfDirs = ksDir.listFiles(); if (cfDir...
[ "public", "static", "List", "<", "File", ">", "getKSChildDirectories", "(", "String", "ksName", ")", "{", "List", "<", "File", ">", "result", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "DataDirectory", "dataDirectory", ":", "dataDirectories", ...
Recursively finds all the sub directories in the KS directory.
[ "Recursively", "finds", "all", "the", "sub", "directories", "in", "the", "KS", "directory", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Directories.java#L665-L681
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/AbstractSSTableSimpleWriter.java
AbstractSSTableSimpleWriter.makeFilename
protected static String makeFilename(File directory, final String keyspace, final String columnFamily) { final Set<Descriptor> existing = new HashSet<Descriptor>(); directory.list(new FilenameFilter() { public boolean accept(File dir, String name) { Pa...
java
protected static String makeFilename(File directory, final String keyspace, final String columnFamily) { final Set<Descriptor> existing = new HashSet<Descriptor>(); directory.list(new FilenameFilter() { public boolean accept(File dir, String name) { Pa...
[ "protected", "static", "String", "makeFilename", "(", "File", "directory", ",", "final", "String", "keyspace", ",", "final", "String", "columnFamily", ")", "{", "final", "Set", "<", "Descriptor", ">", "existing", "=", "new", "HashSet", "<", "Descriptor", ">", ...
find available generation and pick up filename from that
[ "find", "available", "generation", "and", "pick", "up", "filename", "from", "that" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/AbstractSSTableSimpleWriter.java#L68-L96
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java
IndexedSliceReader.setToRowStart
private void setToRowStart(RowIndexEntry rowEntry, FileDataInput in) throws IOException { if (in == null) { this.file = sstable.getFileDataInput(rowEntry.position); } else { this.file = in; in.seek(rowEntry.position); } ssta...
java
private void setToRowStart(RowIndexEntry rowEntry, FileDataInput in) throws IOException { if (in == null) { this.file = sstable.getFileDataInput(rowEntry.position); } else { this.file = in; in.seek(rowEntry.position); } ssta...
[ "private", "void", "setToRowStart", "(", "RowIndexEntry", "rowEntry", ",", "FileDataInput", "in", ")", "throws", "IOException", "{", "if", "(", "in", "==", "null", ")", "{", "this", ".", "file", "=", "sstable", ".", "getFileDataInput", "(", "rowEntry", ".", ...
Sets the seek position to the start of the row for column scanning.
[ "Sets", "the", "seek", "position", "to", "the", "start", "of", "the", "row", "for", "column", "scanning", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/columniterator/IndexedSliceReader.java#L103-L115
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cql3/ColumnCondition.java
ColumnCondition.collectMarkerSpecification
public void collectMarkerSpecification(VariableSpecifications boundNames) { if (collectionElement != null) collectionElement.collectMarkerSpecification(boundNames); if (operator.equals(Operator.IN) && inValues != null) { for (Term value : inValues) va...
java
public void collectMarkerSpecification(VariableSpecifications boundNames) { if (collectionElement != null) collectionElement.collectMarkerSpecification(boundNames); if (operator.equals(Operator.IN) && inValues != null) { for (Term value : inValues) va...
[ "public", "void", "collectMarkerSpecification", "(", "VariableSpecifications", "boundNames", ")", "{", "if", "(", "collectionElement", "!=", "null", ")", "collectionElement", ".", "collectMarkerSpecification", "(", "boundNames", ")", ";", "if", "(", "operator", ".", ...
Collects the column specification for the bind variables of this operation. @param boundNames the list of column specification where to collect the bind variables of this term in.
[ "Collects", "the", "column", "specification", "for", "the", "bind", "variables", "of", "this", "operation", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/ColumnCondition.java#L105-L119
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/streaming/DefaultConnectionFactory.java
DefaultConnectionFactory.createConnection
public Socket createConnection(InetAddress peer) throws IOException { int attempts = 0; while (true) { try { Socket socket = OutboundTcpConnectionPool.newSocket(peer); socket.setSoTimeout(DatabaseDescriptor.getStreamingSocketTimeout());...
java
public Socket createConnection(InetAddress peer) throws IOException { int attempts = 0; while (true) { try { Socket socket = OutboundTcpConnectionPool.newSocket(peer); socket.setSoTimeout(DatabaseDescriptor.getStreamingSocketTimeout());...
[ "public", "Socket", "createConnection", "(", "InetAddress", "peer", ")", "throws", "IOException", "{", "int", "attempts", "=", "0", ";", "while", "(", "true", ")", "{", "try", "{", "Socket", "socket", "=", "OutboundTcpConnectionPool", ".", "newSocket", "(", ...
Connect to peer and start exchanging message. When connect attempt fails, this retries for maximum of MAX_CONNECT_ATTEMPTS times. @param peer the peer to connect to. @return the created socket. @throws IOException when connection failed.
[ "Connect", "to", "peer", "and", "start", "exchanging", "message", ".", "When", "connect", "attempt", "fails", "this", "retries", "for", "maximum", "of", "MAX_CONNECT_ATTEMPTS", "times", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/DefaultConnectionFactory.java#L45-L74
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/MerkleTree.java
MerkleTree.init
public void init() { // determine the depth to which we can safely split the tree byte sizedepth = (byte)(Math.log10(maxsize) / Math.log10(2)); byte depth = (byte)Math.min(sizedepth, hashdepth); root = initHelper(fullRange.left, fullRange.right, (byte)0, depth); size = (long...
java
public void init() { // determine the depth to which we can safely split the tree byte sizedepth = (byte)(Math.log10(maxsize) / Math.log10(2)); byte depth = (byte)Math.min(sizedepth, hashdepth); root = initHelper(fullRange.left, fullRange.right, (byte)0, depth); size = (long...
[ "public", "void", "init", "(", ")", "{", "// determine the depth to which we can safely split the tree", "byte", "sizedepth", "=", "(", "byte", ")", "(", "Math", ".", "log10", "(", "maxsize", ")", "/", "Math", ".", "log10", "(", "2", ")", ")", ";", "byte", ...
Initializes this tree by splitting it until hashdepth is reached, or until an additional level of splits would violate maxsize. NB: Replaces all nodes in the tree.
[ "Initializes", "this", "tree", "by", "splitting", "it", "until", "hashdepth", "is", "reached", "or", "until", "an", "additional", "level", "of", "splits", "would", "violate", "maxsize", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/MerkleTree.java#L167-L175
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/MerkleTree.java
MerkleTree.get
public TreeRange get(Token t) { return getHelper(root, fullRange.left, fullRange.right, (byte)0, t); }
java
public TreeRange get(Token t) { return getHelper(root, fullRange.left, fullRange.right, (byte)0, t); }
[ "public", "TreeRange", "get", "(", "Token", "t", ")", "{", "return", "getHelper", "(", "root", ",", "fullRange", ".", "left", ",", "fullRange", ".", "right", ",", "(", "byte", ")", "0", ",", "t", ")", ";", "}" ]
For testing purposes. Gets the smallest range containing the token.
[ "For", "testing", "purposes", ".", "Gets", "the", "smallest", "range", "containing", "the", "token", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/MerkleTree.java#L320-L323
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/MerkleTree.java
MerkleTree.split
public boolean split(Token t) { if (!(size < maxsize)) return false; try { root = splitHelper(root, fullRange.left, fullRange.right, (byte)0, t); } catch (StopRecursion.TooDeep e) { return false; } return true; ...
java
public boolean split(Token t) { if (!(size < maxsize)) return false; try { root = splitHelper(root, fullRange.left, fullRange.right, (byte)0, t); } catch (StopRecursion.TooDeep e) { return false; } return true; ...
[ "public", "boolean", "split", "(", "Token", "t", ")", "{", "if", "(", "!", "(", "size", "<", "maxsize", ")", ")", "return", "false", ";", "try", "{", "root", "=", "splitHelper", "(", "root", ",", "fullRange", ".", "left", ",", "fullRange", ".", "ri...
Splits the range containing the given token, if no tree limits would be violated. If the range would be split to a depth below hashdepth, or if the tree already contains maxsize subranges, this operation will fail. @return True if the range was successfully split.
[ "Splits", "the", "range", "containing", "the", "given", "token", "if", "no", "tree", "limits", "would", "be", "violated", ".", "If", "the", "range", "would", "be", "split", "to", "a", "depth", "below", "hashdepth", "or", "if", "the", "tree", "already", "...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/MerkleTree.java#L441-L455
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/JVMStabilityInspector.java
JVMStabilityInspector.inspectThrowable
public static void inspectThrowable(Throwable t) { boolean isUnstable = false; if (t instanceof OutOfMemoryError) isUnstable = true; if (DatabaseDescriptor.getDiskFailurePolicy() == Config.DiskFailurePolicy.die) if (t instanceof FSError || t instanceof CorruptSSTable...
java
public static void inspectThrowable(Throwable t) { boolean isUnstable = false; if (t instanceof OutOfMemoryError) isUnstable = true; if (DatabaseDescriptor.getDiskFailurePolicy() == Config.DiskFailurePolicy.die) if (t instanceof FSError || t instanceof CorruptSSTable...
[ "public", "static", "void", "inspectThrowable", "(", "Throwable", "t", ")", "{", "boolean", "isUnstable", "=", "false", ";", "if", "(", "t", "instanceof", "OutOfMemoryError", ")", "isUnstable", "=", "true", ";", "if", "(", "DatabaseDescriptor", ".", "getDiskFa...
Certain Throwables and Exceptions represent "Die" conditions for the server. @param t The Throwable to check for server-stop conditions
[ "Certain", "Throwables", "and", "Exceptions", "represent", "Die", "conditions", "for", "the", "server", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/JVMStabilityInspector.java#L48-L65
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/CollationController.java
CollationController.reduceNameFilter
private void reduceNameFilter(QueryFilter filter, ColumnFamily container, long sstableTimestamp) { if (container == null) return; for (Iterator<CellName> iterator = ((NamesQueryFilter) filter.filter).columns.iterator(); iterator.hasNext(); ) { CellName filterColumn =...
java
private void reduceNameFilter(QueryFilter filter, ColumnFamily container, long sstableTimestamp) { if (container == null) return; for (Iterator<CellName> iterator = ((NamesQueryFilter) filter.filter).columns.iterator(); iterator.hasNext(); ) { CellName filterColumn =...
[ "private", "void", "reduceNameFilter", "(", "QueryFilter", "filter", ",", "ColumnFamily", "container", ",", "long", "sstableTimestamp", ")", "{", "if", "(", "container", "==", "null", ")", "return", ";", "for", "(", "Iterator", "<", "CellName", ">", "iterator"...
remove columns from @param filter where we already have data in @param container newer than @param sstableTimestamp
[ "remove", "columns", "from" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/CollationController.java#L184-L196
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/index/composites/CompositesIndex.java
CompositesIndex.getIndexComparator
public static CellNameType getIndexComparator(CFMetaData baseMetadata, ColumnDefinition cfDef) { if (cfDef.type.isCollection() && cfDef.type.isMultiCell()) { switch (((CollectionType)cfDef.type).kind) { case LIST: return CompositesIndexOnCo...
java
public static CellNameType getIndexComparator(CFMetaData baseMetadata, ColumnDefinition cfDef) { if (cfDef.type.isCollection() && cfDef.type.isMultiCell()) { switch (((CollectionType)cfDef.type).kind) { case LIST: return CompositesIndexOnCo...
[ "public", "static", "CellNameType", "getIndexComparator", "(", "CFMetaData", "baseMetadata", ",", "ColumnDefinition", "cfDef", ")", "{", "if", "(", "cfDef", ".", "type", ".", "isCollection", "(", ")", "&&", "cfDef", ".", "type", ".", "isMultiCell", "(", ")", ...
Check SecondaryIndex.getIndexComparator if you want to know why this is static
[ "Check", "SecondaryIndex", ".", "getIndexComparator", "if", "you", "want", "to", "know", "why", "this", "is", "static" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/composites/CompositesIndex.java#L91-L120
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java
ColumnFamilyRecordReader.getLocation
private String getLocation() { Collection<InetAddress> localAddresses = FBUtilities.getAllLocalAddresses(); for (InetAddress address : localAddresses) { for (String location : split.getLocations()) { InetAddress locationAddress = null; ...
java
private String getLocation() { Collection<InetAddress> localAddresses = FBUtilities.getAllLocalAddresses(); for (InetAddress address : localAddresses) { for (String location : split.getLocations()) { InetAddress locationAddress = null; ...
[ "private", "String", "getLocation", "(", ")", "{", "Collection", "<", "InetAddress", ">", "localAddresses", "=", "FBUtilities", ".", "getAllLocalAddresses", "(", ")", ";", "for", "(", "InetAddress", "address", ":", "localAddresses", ")", "{", "for", "(", "Stri...
not necessarily on Cassandra machines, too. This should be adequate for single-DC clusters, at least.
[ "not", "necessarily", "on", "Cassandra", "machines", "too", ".", "This", "should", "be", "adequate", "for", "single", "-", "DC", "clusters", "at", "least", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java#L189-L213
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/thrift/ThriftConversion.java
ThriftConversion.rethrow
public static RuntimeException rethrow(RequestExecutionException e) throws UnavailableException, TimedOutException { if (e instanceof RequestTimeoutException) throw toThrift((RequestTimeoutException)e); else throw new UnavailableException(); }
java
public static RuntimeException rethrow(RequestExecutionException e) throws UnavailableException, TimedOutException { if (e instanceof RequestTimeoutException) throw toThrift((RequestTimeoutException)e); else throw new UnavailableException(); }
[ "public", "static", "RuntimeException", "rethrow", "(", "RequestExecutionException", "e", ")", "throws", "UnavailableException", ",", "TimedOutException", "{", "if", "(", "e", "instanceof", "RequestTimeoutException", ")", "throw", "toThrift", "(", "(", "RequestTimeoutEx...
for methods that have a return value.
[ "for", "methods", "that", "have", "a", "return", "value", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/ThriftConversion.java#L76-L82
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java
OutboundTcpConnectionPool.getConnection
OutboundTcpConnection getConnection(MessageOut msg) { Stage stage = msg.getStage(); return stage == Stage.REQUEST_RESPONSE || stage == Stage.INTERNAL_RESPONSE || stage == Stage.GOSSIP ? ackCon : cmdCon; }
java
OutboundTcpConnection getConnection(MessageOut msg) { Stage stage = msg.getStage(); return stage == Stage.REQUEST_RESPONSE || stage == Stage.INTERNAL_RESPONSE || stage == Stage.GOSSIP ? ackCon : cmdCon; }
[ "OutboundTcpConnection", "getConnection", "(", "MessageOut", "msg", ")", "{", "Stage", "stage", "=", "msg", ".", "getStage", "(", ")", ";", "return", "stage", "==", "Stage", ".", "REQUEST_RESPONSE", "||", "stage", "==", "Stage", ".", "INTERNAL_RESPONSE", "||",...
returns the appropriate connection based on message type. returns null if a connection could not be established.
[ "returns", "the", "appropriate", "connection", "based", "on", "message", "type", ".", "returns", "null", "if", "a", "connection", "could", "not", "be", "established", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java#L62-L68
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/contrib/NotifyingBlockingThreadPoolExecutor.java
NotifyingBlockingThreadPoolExecutor.execute
@Override public void execute(Runnable task) { // count a new task in process tasksInProcess.incrementAndGet(); try { super.execute(task); } catch (RuntimeException e) { // specifically handle RejectedExecutionException tasksInProcess.decrementAndGet(); ...
java
@Override public void execute(Runnable task) { // count a new task in process tasksInProcess.incrementAndGet(); try { super.execute(task); } catch (RuntimeException e) { // specifically handle RejectedExecutionException tasksInProcess.decrementAndGet(); ...
[ "@", "Override", "public", "void", "execute", "(", "Runnable", "task", ")", "{", "// count a new task in process", "tasksInProcess", ".", "incrementAndGet", "(", ")", ";", "try", "{", "super", ".", "execute", "(", "task", ")", ";", "}", "catch", "(", "Runtim...
Before calling super's version of this method, the amount of tasks which are currently in process is first incremented. @see java.util.concurrent.ThreadPoolExecutor#execute(Runnable)
[ "Before", "calling", "super", "s", "version", "of", "this", "method", "the", "amount", "of", "tasks", "which", "are", "currently", "in", "process", "is", "first", "incremented", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/NotifyingBlockingThreadPoolExecutor.java#L123-L136
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/Downsampling.java
Downsampling.getEffectiveIndexIntervalAfterIndex
public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval) { assert index >= 0; index %= samplingLevel; List<Integer> originalIndexes = getOriginalIndexes(samplingLevel); int nextEntryOriginalIndex = (index == originalIndexes.size() - 1)...
java
public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval) { assert index >= 0; index %= samplingLevel; List<Integer> originalIndexes = getOriginalIndexes(samplingLevel); int nextEntryOriginalIndex = (index == originalIndexes.size() - 1)...
[ "public", "static", "int", "getEffectiveIndexIntervalAfterIndex", "(", "int", "index", ",", "int", "samplingLevel", ",", "int", "minIndexInterval", ")", "{", "assert", "index", ">=", "0", ";", "index", "%=", "samplingLevel", ";", "List", "<", "Integer", ">", "...
Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this returns the number of partitions in the primary on-disk index before the next partition that has an entry in the index summary. If samplingLevel == BASE_SAMPLING_LEVEL, this will be equal to the index interval....
[ "Calculates", "the", "effective", "index", "interval", "after", "the", "entry", "at", "index", "in", "an", "IndexSummary", ".", "In", "other", "words", "this", "returns", "the", "number", "of", "partitions", "in", "the", "primary", "on", "-", "disk", "index"...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/Downsampling.java#L116-L123
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
CommitLogSegment.allocate
Allocation allocate(Mutation mutation, int size) { final OpOrder.Group opGroup = appendOrder.start(); try { int position = allocate(size); if (position < 0) { opGroup.close(); return null; } markDirty...
java
Allocation allocate(Mutation mutation, int size) { final OpOrder.Group opGroup = appendOrder.start(); try { int position = allocate(size); if (position < 0) { opGroup.close(); return null; } markDirty...
[ "Allocation", "allocate", "(", "Mutation", "mutation", ",", "int", "size", ")", "{", "final", "OpOrder", ".", "Group", "opGroup", "=", "appendOrder", ".", "start", "(", ")", ";", "try", "{", "int", "position", "=", "allocate", "(", "size", ")", ";", "i...
Allocate space in this buffer for the provided mutation, and return the allocated Allocation object. Returns null if there is not enough space in this segment, and a new segment is needed.
[ "Allocate", "space", "in", "this", "buffer", "for", "the", "provided", "mutation", "and", "return", "the", "allocated", "Allocation", "object", ".", "Returns", "null", "if", "there", "is", "not", "enough", "space", "in", "this", "segment", "and", "a", "new",...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L185-L204
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
CommitLogSegment.allocate
private int allocate(int size) { while (true) { int prev = allocatePosition.get(); int next = prev + size; if (next >= buffer.capacity()) return -1; if (allocatePosition.compareAndSet(prev, next)) return prev; } ...
java
private int allocate(int size) { while (true) { int prev = allocatePosition.get(); int next = prev + size; if (next >= buffer.capacity()) return -1; if (allocatePosition.compareAndSet(prev, next)) return prev; } ...
[ "private", "int", "allocate", "(", "int", "size", ")", "{", "while", "(", "true", ")", "{", "int", "prev", "=", "allocatePosition", ".", "get", "(", ")", ";", "int", "next", "=", "prev", "+", "size", ";", "if", "(", "next", ">=", "buffer", ".", "...
allocate bytes in the segment, or return -1 if not enough space
[ "allocate", "bytes", "in", "the", "segment", "or", "return", "-", "1", "if", "not", "enough", "space" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L207-L218
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
CommitLogSegment.discardUnusedTail
void discardUnusedTail() { // we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom() // this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block // already protected by this OpOrde...
java
void discardUnusedTail() { // we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom() // this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block // already protected by this OpOrde...
[ "void", "discardUnusedTail", "(", ")", "{", "// we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom()", "// this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block", "// already protected ...
ensures no more of this segment is writeable, by allocating any unused section at the end and marking it discarded
[ "ensures", "no", "more", "of", "this", "segment", "is", "writeable", "by", "allocating", "any", "unused", "section", "at", "the", "end", "and", "marking", "it", "discarded" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L221-L243
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
CommitLogSegment.sync
synchronized void sync() { try { // check we have more work to do if (allocatePosition.get() <= lastSyncedOffset + SYNC_MARKER_SIZE) return; // allocate a new sync marker; this is both necessary in itself, but also serves to demarcate ...
java
synchronized void sync() { try { // check we have more work to do if (allocatePosition.get() <= lastSyncedOffset + SYNC_MARKER_SIZE) return; // allocate a new sync marker; this is both necessary in itself, but also serves to demarcate ...
[ "synchronized", "void", "sync", "(", ")", "{", "try", "{", "// check we have more work to do", "if", "(", "allocatePosition", ".", "get", "(", ")", "<=", "lastSyncedOffset", "+", "SYNC_MARKER_SIZE", ")", "return", ";", "// allocate a new sync marker; this is both necess...
Forces a disk flush for this segment file.
[ "Forces", "a", "disk", "flush", "for", "this", "segment", "file", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L257-L331
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
CommitLogSegment.recycle
CommitLogSegment recycle() { try { sync(); } catch (FSWriteError e) { logger.error("I/O error flushing {} {}", this, e.getMessage()); throw e; } close(); return new CommitLogSegment(getPath()); }
java
CommitLogSegment recycle() { try { sync(); } catch (FSWriteError e) { logger.error("I/O error flushing {} {}", this, e.getMessage()); throw e; } close(); return new CommitLogSegment(getPath()); }
[ "CommitLogSegment", "recycle", "(", ")", "{", "try", "{", "sync", "(", ")", ";", "}", "catch", "(", "FSWriteError", "e", ")", "{", "logger", ".", "error", "(", "\"I/O error flushing {} {}\"", ",", "this", ",", "e", ".", "getMessage", "(", ")", ")", ";"...
Recycle processes an unneeded segment file for reuse. @return a new CommitLogSegment representing the newly reusable segment.
[ "Recycle", "processes", "an", "unneeded", "segment", "file", "for", "reuse", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L351-L366
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
CommitLogSegment.markClean
public synchronized void markClean(UUID cfId, ReplayPosition context) { if (!cfDirty.containsKey(cfId)) return; if (context.segment == id) markClean(cfId, context.position); else if (context.segment > id) markClean(cfId, Integer.MAX_VALUE); }
java
public synchronized void markClean(UUID cfId, ReplayPosition context) { if (!cfDirty.containsKey(cfId)) return; if (context.segment == id) markClean(cfId, context.position); else if (context.segment > id) markClean(cfId, Integer.MAX_VALUE); }
[ "public", "synchronized", "void", "markClean", "(", "UUID", "cfId", ",", "ReplayPosition", "context", ")", "{", "if", "(", "!", "cfDirty", ".", "containsKey", "(", "cfId", ")", ")", "return", ";", "if", "(", "context", ".", "segment", "==", "id", ")", ...
Marks the ColumnFamily specified by cfId as clean for this log segment. If the given context argument is contained in this file, it will only mark the CF as clean if no newer writes have taken place. @param cfId the column family ID that is now clean @param context the optional clean offset
[ "Marks", "the", "ColumnFamily", "specified", "by", "cfId", "as", "clean", "for", "this", "log", "segment", ".", "If", "the", "given", "context", "argument", "is", "contained", "in", "this", "file", "it", "will", "only", "mark", "the", "CF", "as", "clean", ...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L455-L463
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java
CommitLogSegment.dirtyString
public String dirtyString() { StringBuilder sb = new StringBuilder(); for (UUID cfId : getDirtyCFIDs()) { CFMetaData m = Schema.instance.getCFMetaData(cfId); sb.append(m == null ? "<deleted>" : m.cfName).append(" (").append(cfId).append("), "); } retur...
java
public String dirtyString() { StringBuilder sb = new StringBuilder(); for (UUID cfId : getDirtyCFIDs()) { CFMetaData m = Schema.instance.getCFMetaData(cfId); sb.append(m == null ? "<deleted>" : m.cfName).append(" (").append(cfId).append("), "); } retur...
[ "public", "String", "dirtyString", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "UUID", "cfId", ":", "getDirtyCFIDs", "(", ")", ")", "{", "CFMetaData", "m", "=", "Schema", ".", "instance", ".", "getCFMetaD...
For debugging, not fast
[ "For", "debugging", "not", "fast" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L557-L566
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/streaming/StreamPlan.java
StreamPlan.transferFiles
public StreamPlan transferFiles(InetAddress to, Collection<StreamSession.SSTableStreamingSections> sstableDetails) { coordinator.transferFiles(to, sstableDetails); return this; }
java
public StreamPlan transferFiles(InetAddress to, Collection<StreamSession.SSTableStreamingSections> sstableDetails) { coordinator.transferFiles(to, sstableDetails); return this; }
[ "public", "StreamPlan", "transferFiles", "(", "InetAddress", "to", ",", "Collection", "<", "StreamSession", ".", "SSTableStreamingSections", ">", "sstableDetails", ")", "{", "coordinator", ".", "transferFiles", "(", "to", ",", "sstableDetails", ")", ";", "return", ...
Add transfer task to send given SSTable files. @param to endpoint address of receiver @param sstableDetails sstables with file positions and estimated key count. this collection will be modified to remove those files that are successfully handed off @return this object for chaining
[ "Add", "transfer", "task", "to", "send", "given", "SSTable", "files", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/StreamPlan.java#L142-L147
train