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/auth/CassandraAuthorizer.java
CassandraAuthorizer.list
public Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, String of) throws RequestValidationException, RequestExecutionException { if (!performer.isSuper() && !performer.getName().equals(of)) throw new UnauthorizedException(String.forma...
java
public Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, String of) throws RequestValidationException, RequestExecutionException { if (!performer.isSuper() && !performer.getName().equals(of)) throw new UnauthorizedException(String.forma...
[ "public", "Set", "<", "PermissionDetails", ">", "list", "(", "AuthenticatedUser", "performer", ",", "Set", "<", "Permission", ">", "permissions", ",", "IResource", "resource", ",", "String", "of", ")", "throws", "RequestValidationException", ",", "RequestExecutionEx...
allowed to see their own permissions.
[ "allowed", "to", "see", "their", "own", "permissions", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java#L126-L151
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/auth/CassandraAuthorizer.java
CassandraAuthorizer.revokeAll
public void revokeAll(String droppedUser) { try { process(String.format("DELETE FROM %s.%s WHERE username = '%s'", Auth.AUTH_KS, PERMISSIONS_CF, escape(droppedUser))); } catch (RequestExecutionException e) { logger.warn("CassandraAuthorizer failed to r...
java
public void revokeAll(String droppedUser) { try { process(String.format("DELETE FROM %s.%s WHERE username = '%s'", Auth.AUTH_KS, PERMISSIONS_CF, escape(droppedUser))); } catch (RequestExecutionException e) { logger.warn("CassandraAuthorizer failed to r...
[ "public", "void", "revokeAll", "(", "String", "droppedUser", ")", "{", "try", "{", "process", "(", "String", ".", "format", "(", "\"DELETE FROM %s.%s WHERE username = '%s'\"", ",", "Auth", ".", "AUTH_KS", ",", "PERMISSIONS_CF", ",", "escape", "(", "droppedUser", ...
Called prior to deleting the user with DROP USER query. Internal hook, so no permission checks are needed here.
[ "Called", "prior", "to", "deleting", "the", "user", "with", "DROP", "USER", "query", ".", "Internal", "hook", "so", "no", "permission", "checks", "are", "needed", "here", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/auth/CassandraAuthorizer.java#L182-L192
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/util/TaskQueue.java
TaskQueue.submitSynchronous
public void submitSynchronous(Runnable task) { lock.writeLock().lock(); try { awaitInner(); task.run(); } catch (InterruptedException e) { Log.error(e, "Task queue isolated submission interrupted"); throw new RuntimeException(e); } catch (E...
java
public void submitSynchronous(Runnable task) { lock.writeLock().lock(); try { awaitInner(); task.run(); } catch (InterruptedException e) { Log.error(e, "Task queue isolated submission interrupted"); throw new RuntimeException(e); } catch (E...
[ "public", "void", "submitSynchronous", "(", "Runnable", "task", ")", "{", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "awaitInner", "(", ")", ";", "task", ".", "run", "(", ")", ";", "}", "catch", "(", "InterruptedExcep...
Submits a non value-returning task for synchronous execution. It waits for all synchronous tasks to be completed. @param task A task to be executed synchronously.
[ "Submits", "a", "non", "value", "-", "returning", "task", "for", "synchronous", "execution", ".", "It", "waits", "for", "all", "synchronous", "tasks", "to", "be", "completed", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/util/TaskQueue.java#L124-L138
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/CLibrary.java
CLibrary.getfd
public static int getfd(FileDescriptor descriptor) { Field field = FBUtilities.getProtectedField(descriptor.getClass(), "fd"); if (field == null) return -1; try { return field.getInt(descriptor); } catch (Exception e) { JV...
java
public static int getfd(FileDescriptor descriptor) { Field field = FBUtilities.getProtectedField(descriptor.getClass(), "fd"); if (field == null) return -1; try { return field.getInt(descriptor); } catch (Exception e) { JV...
[ "public", "static", "int", "getfd", "(", "FileDescriptor", "descriptor", ")", "{", "Field", "field", "=", "FBUtilities", ".", "getProtectedField", "(", "descriptor", ".", "getClass", "(", ")", ",", "\"fd\"", ")", ";", "if", "(", "field", "==", "null", ")",...
Get system file descriptor from FileDescriptor object. @param descriptor - FileDescriptor objec to get fd from @return file descriptor, -1 or error
[ "Get", "system", "file", "descriptor", "from", "FileDescriptor", "object", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/CLibrary.java#L286-L304
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Memtable.java
Memtable.accepts
public boolean accepts(OpOrder.Group opGroup, ReplayPosition replayPosition) { // if the barrier hasn't been set yet, then this memtable is still taking ALL writes OpOrder.Barrier barrier = this.writeBarrier; if (barrier == null) return true; // if the barrier has been se...
java
public boolean accepts(OpOrder.Group opGroup, ReplayPosition replayPosition) { // if the barrier hasn't been set yet, then this memtable is still taking ALL writes OpOrder.Barrier barrier = this.writeBarrier; if (barrier == null) return true; // if the barrier has been se...
[ "public", "boolean", "accepts", "(", "OpOrder", ".", "Group", "opGroup", ",", "ReplayPosition", "replayPosition", ")", "{", "// if the barrier hasn't been set yet, then this memtable is still taking ALL writes", "OpOrder", ".", "Barrier", "barrier", "=", "this", ".", "write...
decide if this memtable should take the write, or if it should go to the next memtable
[ "decide", "if", "this", "memtable", "should", "take", "the", "write", "or", "if", "it", "should", "go", "to", "the", "next", "memtable" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Memtable.java#L125-L152
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Memtable.java
Memtable.put
long put(DecoratedKey key, ColumnFamily cf, SecondaryIndexManager.Updater indexer, OpOrder.Group opGroup) { AtomicBTreeColumns previous = rows.get(key); if (previous == null) { AtomicBTreeColumns empty = cf.cloneMeShallow(AtomicBTreeColumns.factory, false); final Dec...
java
long put(DecoratedKey key, ColumnFamily cf, SecondaryIndexManager.Updater indexer, OpOrder.Group opGroup) { AtomicBTreeColumns previous = rows.get(key); if (previous == null) { AtomicBTreeColumns empty = cf.cloneMeShallow(AtomicBTreeColumns.factory, false); final Dec...
[ "long", "put", "(", "DecoratedKey", "key", ",", "ColumnFamily", "cf", ",", "SecondaryIndexManager", ".", "Updater", "indexer", ",", "OpOrder", ".", "Group", "opGroup", ")", "{", "AtomicBTreeColumns", "previous", "=", "rows", ".", "get", "(", "key", ")", ";",...
Should only be called by ColumnFamilyStore.apply via Keyspace.apply, which supplies the appropriate OpOrdering. replayPosition should only be null if this is a secondary index, in which case it is *expected* to be null
[ "Should", "only", "be", "called", "by", "ColumnFamilyStore", ".", "apply", "via", "Keyspace", ".", "apply", "which", "supplies", "the", "appropriate", "OpOrdering", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Memtable.java#L184-L212
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/DatabaseDescriptor.java
DatabaseDescriptor.loadSchemas
public static void loadSchemas(boolean updateVersion) { ColumnFamilyStore schemaCFS = SystemKeyspace.schemaCFS(SystemKeyspace.SCHEMA_KEYSPACES_CF); // if keyspace with definitions is empty try loading the old way if (schemaCFS.estimateKeys() == 0) { logger.info("Couldn't...
java
public static void loadSchemas(boolean updateVersion) { ColumnFamilyStore schemaCFS = SystemKeyspace.schemaCFS(SystemKeyspace.SCHEMA_KEYSPACES_CF); // if keyspace with definitions is empty try loading the old way if (schemaCFS.estimateKeys() == 0) { logger.info("Couldn't...
[ "public", "static", "void", "loadSchemas", "(", "boolean", "updateVersion", ")", "{", "ColumnFamilyStore", "schemaCFS", "=", "SystemKeyspace", ".", "schemaCFS", "(", "SystemKeyspace", ".", "SCHEMA_KEYSPACES_CF", ")", ";", "// if keyspace with definitions is empty try loadin...
Load schema definitions. @param updateVersion true if schema version needs to be updated
[ "Load", "schema", "definitions", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L678-L699
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/DatabaseDescriptor.java
DatabaseDescriptor.createAllDirectories
public static void createAllDirectories() { try { if (conf.data_file_directories.length == 0) throw new ConfigurationException("At least one DataFileDirectory must be specified"); for (String dataFileDirectory : conf.data_file_directories) { ...
java
public static void createAllDirectories() { try { if (conf.data_file_directories.length == 0) throw new ConfigurationException("At least one DataFileDirectory must be specified"); for (String dataFileDirectory : conf.data_file_directories) { ...
[ "public", "static", "void", "createAllDirectories", "(", ")", "{", "try", "{", "if", "(", "conf", ".", "data_file_directories", ".", "length", "==", "0", ")", "throw", "new", "ConfigurationException", "(", "\"At least one DataFileDirectory must be specified\"", ")", ...
Creates all storage-related directories.
[ "Creates", "all", "storage", "-", "related", "directories", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L770-L804
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/DatabaseDescriptor.java
DatabaseDescriptor.getTimeout
public static long getTimeout(MessagingService.Verb verb) { switch (verb) { case READ: return getReadRpcTimeout(); case RANGE_SLICE: return getRangeRpcTimeout(); case TRUNCATE: return getTruncateRpcTimeout(); ...
java
public static long getTimeout(MessagingService.Verb verb) { switch (verb) { case READ: return getReadRpcTimeout(); case RANGE_SLICE: return getRangeRpcTimeout(); case TRUNCATE: return getTruncateRpcTimeout(); ...
[ "public", "static", "long", "getTimeout", "(", "MessagingService", ".", "Verb", "verb", ")", "{", "switch", "(", "verb", ")", "{", "case", "READ", ":", "return", "getReadRpcTimeout", "(", ")", ";", "case", "RANGE_SLICE", ":", "return", "getRangeRpcTimeout", ...
not part of the Verb enum so we can change timeouts easily via JMX
[ "not", "part", "of", "the", "Verb", "enum", "so", "we", "can", "change", "timeouts", "easily", "via", "JMX" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/DatabaseDescriptor.java#L1023-L1044
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/security/SSLFactory.java
SSLFactory.getSocket
public static SSLSocket getSocket(EncryptionOptions options, InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { SSLContext ctx = createSSLContext(options, true); SSLSocket socket = (SSLSocket) ctx.getSocketFactory().createSocket(address, port, localAddress, ...
java
public static SSLSocket getSocket(EncryptionOptions options, InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException { SSLContext ctx = createSSLContext(options, true); SSLSocket socket = (SSLSocket) ctx.getSocketFactory().createSocket(address, port, localAddress, ...
[ "public", "static", "SSLSocket", "getSocket", "(", "EncryptionOptions", "options", ",", "InetAddress", "address", ",", "int", "port", ",", "InetAddress", "localAddress", ",", "int", "localPort", ")", "throws", "IOException", "{", "SSLContext", "ctx", "=", "createS...
Create a socket and connect
[ "Create", "a", "socket", "and", "connect" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/security/SSLFactory.java#L70-L78
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/filter/QueryFilter.java
QueryFilter.collateOnDiskAtom
public void collateOnDiskAtom(ColumnFamily returnCF, Iterator<? extends OnDiskAtom> toCollate, int gcBefore) { filter.collectReducedColumns(returnCF, gatherTombstones(returnCF, toCollate), gcBefore, timestamp); }
java
public void collateOnDiskAtom(ColumnFamily returnCF, Iterator<? extends OnDiskAtom> toCollate, int gcBefore) { filter.collectReducedColumns(returnCF, gatherTombstones(returnCF, toCollate), gcBefore, timestamp); }
[ "public", "void", "collateOnDiskAtom", "(", "ColumnFamily", "returnCF", ",", "Iterator", "<", "?", "extends", "OnDiskAtom", ">", "toCollate", ",", "int", "gcBefore", ")", "{", "filter", ".", "collectReducedColumns", "(", "returnCF", ",", "gatherTombstones", "(", ...
When there is only a single source of atoms, we can skip the collate step
[ "When", "there", "is", "only", "a", "single", "source", "of", "atoms", "we", "can", "skip", "the", "collate", "step" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/filter/QueryFilter.java#L85-L88
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/filter/QueryFilter.java
QueryFilter.getIdentityFilter
public static QueryFilter getIdentityFilter(DecoratedKey key, String cfName, long timestamp) { return new QueryFilter(key, cfName, new IdentityQueryFilter(), timestamp); }
java
public static QueryFilter getIdentityFilter(DecoratedKey key, String cfName, long timestamp) { return new QueryFilter(key, cfName, new IdentityQueryFilter(), timestamp); }
[ "public", "static", "QueryFilter", "getIdentityFilter", "(", "DecoratedKey", "key", ",", "String", "cfName", ",", "long", "timestamp", ")", "{", "return", "new", "QueryFilter", "(", "key", ",", "cfName", ",", "new", "IdentityQueryFilter", "(", ")", ",", "times...
return a QueryFilter object that includes every column in the row. This is dangerous on large rows; avoid except for test code.
[ "return", "a", "QueryFilter", "object", "that", "includes", "every", "column", "in", "the", "row", ".", "This", "is", "dangerous", "on", "large", "rows", ";", "avoid", "except", "for", "test", "code", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/filter/QueryFilter.java#L225-L228
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/DataTracker.java
DataTracker.getMemtableFor
public Memtable getMemtableFor(OpOrder.Group opGroup, ReplayPosition replayPosition) { // since any new memtables appended to the list after we fetch it will be for operations started // after us, we can safely assume that we will always find the memtable that 'accepts' us; // if the barrier...
java
public Memtable getMemtableFor(OpOrder.Group opGroup, ReplayPosition replayPosition) { // since any new memtables appended to the list after we fetch it will be for operations started // after us, we can safely assume that we will always find the memtable that 'accepts' us; // if the barrier...
[ "public", "Memtable", "getMemtableFor", "(", "OpOrder", ".", "Group", "opGroup", ",", "ReplayPosition", "replayPosition", ")", "{", "// since any new memtables appended to the list after we fetch it will be for operations started", "// after us, we can safely assume that we will always f...
get the Memtable that the ordered writeOp should be directed to
[ "get", "the", "Memtable", "that", "the", "ordered", "writeOp", "should", "be", "directed", "to" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/DataTracker.java#L60-L75
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/DataTracker.java
DataTracker.replaceWithNewInstances
public void replaceWithNewInstances(Collection<SSTableReader> toReplace, Collection<SSTableReader> replaceWith) { replaceReaders(toReplace, replaceWith, true); }
java
public void replaceWithNewInstances(Collection<SSTableReader> toReplace, Collection<SSTableReader> replaceWith) { replaceReaders(toReplace, replaceWith, true); }
[ "public", "void", "replaceWithNewInstances", "(", "Collection", "<", "SSTableReader", ">", "toReplace", ",", "Collection", "<", "SSTableReader", ">", "replaceWith", ")", "{", "replaceReaders", "(", "toReplace", ",", "replaceWith", ",", "true", ")", ";", "}" ]
Replaces existing sstables with new instances, makes sure compaction strategies have the correct instance @param toReplace @param replaceWith
[ "Replaces", "existing", "sstables", "with", "new", "instances", "makes", "sure", "compaction", "strategies", "have", "the", "correct", "instance" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/DataTracker.java#L305-L308
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/DataTracker.java
DataTracker.replaceEarlyOpenedFiles
public void replaceEarlyOpenedFiles(Collection<SSTableReader> toReplace, Collection<SSTableReader> replaceWith) { for (SSTableReader s : toReplace) assert s.openReason.equals(SSTableReader.OpenReason.EARLY); // note that we can replace an early opened file with a real one replace...
java
public void replaceEarlyOpenedFiles(Collection<SSTableReader> toReplace, Collection<SSTableReader> replaceWith) { for (SSTableReader s : toReplace) assert s.openReason.equals(SSTableReader.OpenReason.EARLY); // note that we can replace an early opened file with a real one replace...
[ "public", "void", "replaceEarlyOpenedFiles", "(", "Collection", "<", "SSTableReader", ">", "toReplace", ",", "Collection", "<", "SSTableReader", ">", "replaceWith", ")", "{", "for", "(", "SSTableReader", "s", ":", "toReplace", ")", "assert", "s", ".", "openReaso...
Adds the early opened files to the data tracker, but does not tell compaction strategies about it note that we dont track the live size of these sstables @param toReplace @param replaceWith
[ "Adds", "the", "early", "opened", "files", "to", "the", "data", "tracker", "but", "does", "not", "tell", "compaction", "strategies", "about", "it" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/DataTracker.java#L317-L323
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/DataTracker.java
DataTracker.unreferenceSSTables
public void unreferenceSSTables() { Set<SSTableReader> notCompacting; View currentView, newView; do { currentView = view.get(); notCompacting = currentView.nonCompactingSStables(); newView = currentView.replace(notCompacting, Collections.<SSTableR...
java
public void unreferenceSSTables() { Set<SSTableReader> notCompacting; View currentView, newView; do { currentView = view.get(); notCompacting = currentView.nonCompactingSStables(); newView = currentView.replace(notCompacting, Collections.<SSTableR...
[ "public", "void", "unreferenceSSTables", "(", ")", "{", "Set", "<", "SSTableReader", ">", "notCompacting", ";", "View", "currentView", ",", "newView", ";", "do", "{", "currentView", "=", "view", ".", "get", "(", ")", ";", "notCompacting", "=", "currentView",...
removes all sstables that are not busy compacting.
[ "removes", "all", "sstables", "that", "are", "not", "busy", "compacting", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/DataTracker.java#L328-L349
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/DataTracker.java
DataTracker.removeUnreadableSSTables
void removeUnreadableSSTables(File directory) { View currentView, newView; Set<SSTableReader> remaining = new HashSet<>(); do { currentView = view.get(); for (SSTableReader r : currentView.nonCompactingSStables()) if (!r.descriptor.directory.eq...
java
void removeUnreadableSSTables(File directory) { View currentView, newView; Set<SSTableReader> remaining = new HashSet<>(); do { currentView = view.get(); for (SSTableReader r : currentView.nonCompactingSStables()) if (!r.descriptor.directory.eq...
[ "void", "removeUnreadableSSTables", "(", "File", "directory", ")", "{", "View", "currentView", ",", "newView", ";", "Set", "<", "SSTableReader", ">", "remaining", "=", "new", "HashSet", "<>", "(", ")", ";", "do", "{", "currentView", "=", "view", ".", "get"...
Removes every SSTable in the directory from the DataTracker's view. @param directory the unreadable directory, possibly with SSTables in it, but not necessarily.
[ "Removes", "every", "SSTable", "in", "the", "directory", "from", "the", "DataTracker", "s", "view", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/DataTracker.java#L355-L376
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandUser.java
SettingsCommandUser.build
public static SettingsCommandUser build(String[] params) { GroupedOptions options = GroupedOptions.select(params, new Options(new Uncertainty()), new Options(new Duration()), new Options(new Count())); if (options == null) { printHe...
java
public static SettingsCommandUser build(String[] params) { GroupedOptions options = GroupedOptions.select(params, new Options(new Uncertainty()), new Options(new Duration()), new Options(new Count())); if (options == null) { printHe...
[ "public", "static", "SettingsCommandUser", "build", "(", "String", "[", "]", "params", ")", "{", "GroupedOptions", "options", "=", "GroupedOptions", ".", "select", "(", "params", ",", "new", "Options", "(", "new", "Uncertainty", "(", ")", ")", ",", "new", ...
CLI utility methods
[ "CLI", "utility", "methods" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/settings/SettingsCommandUser.java#L117-L130
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/contrib/ComparatorChain.java
ComparatorChain.addComparator
public void addComparator(Comparator<T> comparator, boolean reverse) { checkLocked(); comparatorChain.add(comparator); if (reverse == true) { orderingBits.set(comparatorChain.size() - 1); } }
java
public void addComparator(Comparator<T> comparator, boolean reverse) { checkLocked(); comparatorChain.add(comparator); if (reverse == true) { orderingBits.set(comparatorChain.size() - 1); } }
[ "public", "void", "addComparator", "(", "Comparator", "<", "T", ">", "comparator", ",", "boolean", "reverse", ")", "{", "checkLocked", "(", ")", ";", "comparatorChain", ".", "add", "(", "comparator", ")", ";", "if", "(", "reverse", "==", "true", ")", "{"...
Add a Comparator to the end of the chain using the given sortFields order @param comparator Comparator to add to the end of the chain @param reverse false = forward sortFields order; true = reverse sortFields order
[ "Add", "a", "Comparator", "to", "the", "end", "of", "the", "chain", "using", "the", "given", "sortFields", "order" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/ComparatorChain.java#L135-L142
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/contrib/ComparatorChain.java
ComparatorChain.setComparator
public void setComparator(int index, Comparator<T> comparator) throws IndexOutOfBoundsException { setComparator(index, comparator, false); }
java
public void setComparator(int index, Comparator<T> comparator) throws IndexOutOfBoundsException { setComparator(index, comparator, false); }
[ "public", "void", "setComparator", "(", "int", "index", ",", "Comparator", "<", "T", ">", "comparator", ")", "throws", "IndexOutOfBoundsException", "{", "setComparator", "(", "index", ",", "comparator", ",", "false", ")", ";", "}" ]
Replace the Comparator at the given index, maintaining the existing sortFields order. @param index index of the Comparator to replace @param comparator Comparator to place at the given index @throws IndexOutOfBoundsException if index &lt; 0 or index &gt;= size()
[ "Replace", "the", "Comparator", "at", "the", "given", "index", "maintaining", "the", "existing", "sortFields", "order", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/ComparatorChain.java#L151-L153
train
Stratio/stratio-cassandra
src/java/com/stratio/cassandra/contrib/ComparatorChain.java
ComparatorChain.setComparator
public void setComparator(int index, Comparator<T> comparator, boolean reverse) { checkLocked(); comparatorChain.set(index, comparator); if (reverse == true) { orderingBits.set(index); } else { orderingBits.clear(index); } }
java
public void setComparator(int index, Comparator<T> comparator, boolean reverse) { checkLocked(); comparatorChain.set(index, comparator); if (reverse == true) { orderingBits.set(index); } else { orderingBits.clear(index); } }
[ "public", "void", "setComparator", "(", "int", "index", ",", "Comparator", "<", "T", ">", "comparator", ",", "boolean", "reverse", ")", "{", "checkLocked", "(", ")", ";", "comparatorChain", ".", "set", "(", "index", ",", "comparator", ")", ";", "if", "("...
Replace the Comparator at the given index in the ComparatorChain, using the given sortFields order @param index index of the Comparator to replace @param comparator Comparator to set @param reverse false = forward sortFields order; true = reverse sortFields order
[ "Replace", "the", "Comparator", "at", "the", "given", "index", "in", "the", "ComparatorChain", "using", "the", "given", "sortFields", "order" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/ComparatorChain.java#L162-L171
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/KSMetaData.java
KSMetaData.fromSchema
public static KSMetaData fromSchema(Row row, Iterable<CFMetaData> cfms, UTMetaData userTypes) { UntypedResultSet.Row result = QueryProcessor.resultify("SELECT * FROM system.schema_keyspaces", row).one(); try { return new KSMetaData(result.getString("keyspace_name"), ...
java
public static KSMetaData fromSchema(Row row, Iterable<CFMetaData> cfms, UTMetaData userTypes) { UntypedResultSet.Row result = QueryProcessor.resultify("SELECT * FROM system.schema_keyspaces", row).one(); try { return new KSMetaData(result.getString("keyspace_name"), ...
[ "public", "static", "KSMetaData", "fromSchema", "(", "Row", "row", ",", "Iterable", "<", "CFMetaData", ">", "cfms", ",", "UTMetaData", "userTypes", ")", "{", "UntypedResultSet", ".", "Row", "result", "=", "QueryProcessor", ".", "resultify", "(", "\"SELECT * FROM...
Deserialize only Keyspace attributes without nested ColumnFamilies @param row Keyspace attributes in serialized form @return deserialized keyspace without cf_defs
[ "Deserialize", "only", "Keyspace", "attributes", "without", "nested", "ColumnFamilies" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/KSMetaData.java#L274-L290
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/KSMetaData.java
KSMetaData.fromSchema
public static KSMetaData fromSchema(Row serializedKs, Row serializedCFs, Row serializedUserTypes) { Map<String, CFMetaData> cfs = deserializeColumnFamilies(serializedCFs); UTMetaData userTypes = new UTMetaData(UTMetaData.fromSchema(serializedUserTypes)); return fromSchema(serializedKs, cfs.v...
java
public static KSMetaData fromSchema(Row serializedKs, Row serializedCFs, Row serializedUserTypes) { Map<String, CFMetaData> cfs = deserializeColumnFamilies(serializedCFs); UTMetaData userTypes = new UTMetaData(UTMetaData.fromSchema(serializedUserTypes)); return fromSchema(serializedKs, cfs.v...
[ "public", "static", "KSMetaData", "fromSchema", "(", "Row", "serializedKs", ",", "Row", "serializedCFs", ",", "Row", "serializedUserTypes", ")", "{", "Map", "<", "String", ",", "CFMetaData", ">", "cfs", "=", "deserializeColumnFamilies", "(", "serializedCFs", ")", ...
Deserialize Keyspace with nested ColumnFamilies @param serializedKs Keyspace in serialized form @param serializedCFs Collection of the serialized ColumnFamilies @return deserialized keyspace with cf_defs
[ "Deserialize", "Keyspace", "with", "nested", "ColumnFamilies" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/KSMetaData.java#L300-L305
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/config/KSMetaData.java
KSMetaData.deserializeColumnFamilies
public static Map<String, CFMetaData> deserializeColumnFamilies(Row row) { if (row.cf == null) return Collections.emptyMap(); Map<String, CFMetaData> cfms = new HashMap<>(); UntypedResultSet results = QueryProcessor.resultify("SELECT * FROM system.schema_columnfamilies", row); ...
java
public static Map<String, CFMetaData> deserializeColumnFamilies(Row row) { if (row.cf == null) return Collections.emptyMap(); Map<String, CFMetaData> cfms = new HashMap<>(); UntypedResultSet results = QueryProcessor.resultify("SELECT * FROM system.schema_columnfamilies", row); ...
[ "public", "static", "Map", "<", "String", ",", "CFMetaData", ">", "deserializeColumnFamilies", "(", "Row", "row", ")", "{", "if", "(", "row", ".", "cf", "==", "null", ")", "return", "Collections", ".", "emptyMap", "(", ")", ";", "Map", "<", "String", "...
Deserialize ColumnFamilies from low-level schema representation, all of them belong to the same keyspace @return map containing name of the ColumnFamily and it's metadata for faster lookup
[ "Deserialize", "ColumnFamilies", "from", "low", "-", "level", "schema", "representation", "all", "of", "them", "belong", "to", "the", "same", "keyspace" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/KSMetaData.java#L312-L325
train
Stratio/stratio-cassandra
tools/stress/src/org/apache/cassandra/stress/util/TimingInterval.java
TimingInterval.merge
static TimingInterval merge(Iterable<TimingInterval> intervals, int maxSamples, long start) { ThreadLocalRandom rnd = ThreadLocalRandom.current(); long operationCount = 0, partitionCount = 0, rowCount = 0, errorCount = 0; long maxLatency = 0, totalLatency = 0; List<SampleOfLongs> lat...
java
static TimingInterval merge(Iterable<TimingInterval> intervals, int maxSamples, long start) { ThreadLocalRandom rnd = ThreadLocalRandom.current(); long operationCount = 0, partitionCount = 0, rowCount = 0, errorCount = 0; long maxLatency = 0, totalLatency = 0; List<SampleOfLongs> lat...
[ "static", "TimingInterval", "merge", "(", "Iterable", "<", "TimingInterval", ">", "intervals", ",", "int", "maxSamples", ",", "long", "start", ")", "{", "ThreadLocalRandom", "rnd", "=", "ThreadLocalRandom", ".", "current", "(", ")", ";", "long", "operationCount"...
merge multiple timer intervals together
[ "merge", "multiple", "timer", "intervals", "together" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/TimingInterval.java#L79-L115
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/RangeTombstone.java
RangeTombstone.supersedes
public boolean supersedes(RangeTombstone rt, Comparator<Composite> comparator) { if (rt.data.markedForDeleteAt > data.markedForDeleteAt) return false; return comparator.compare(min, rt.min) <= 0 && comparator.compare(max, rt.max) >= 0; }
java
public boolean supersedes(RangeTombstone rt, Comparator<Composite> comparator) { if (rt.data.markedForDeleteAt > data.markedForDeleteAt) return false; return comparator.compare(min, rt.min) <= 0 && comparator.compare(max, rt.max) >= 0; }
[ "public", "boolean", "supersedes", "(", "RangeTombstone", "rt", ",", "Comparator", "<", "Composite", ">", "comparator", ")", "{", "if", "(", "rt", ".", "data", ".", "markedForDeleteAt", ">", "data", ".", "markedForDeleteAt", ")", "return", "false", ";", "ret...
This tombstone supersedes another one if it is more recent and cover a bigger range than rt.
[ "This", "tombstone", "supersedes", "another", "one", "if", "it", "is", "more", "recent", "and", "cover", "a", "bigger", "range", "than", "rt", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/RangeTombstone.java#L89-L95
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/ByteBufferUtil.java
ByteBufferUtil.string
public static String string(ByteBuffer buffer, int position, int length) throws CharacterCodingException { return string(buffer, position, length, StandardCharsets.UTF_8); }
java
public static String string(ByteBuffer buffer, int position, int length) throws CharacterCodingException { return string(buffer, position, length, StandardCharsets.UTF_8); }
[ "public", "static", "String", "string", "(", "ByteBuffer", "buffer", ",", "int", "position", ",", "int", "length", ")", "throws", "CharacterCodingException", "{", "return", "string", "(", "buffer", ",", "position", ",", "length", ",", "StandardCharsets", ".", ...
Decode a String representation. This method assumes that the encoding charset is UTF_8. @param buffer a byte buffer holding the string representation @param position the starting position in {@code buffer} to start decoding from @param length the number of bytes from {@code buffer} to use @return the decoded string
[ "Decode", "a", "String", "representation", ".", "This", "method", "assumes", "that", "the", "encoding", "charset", "is", "UTF_8", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/ByteBufferUtil.java#L121-L124
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/ByteBufferUtil.java
ByteBufferUtil.compareSubArrays
public static int compareSubArrays(ByteBuffer bytes1, int offset1, ByteBuffer bytes2, int offset2, int length) { if (bytes1 == null) return bytes2 == null ? 0 : -1; if (bytes2 == null) return 1; assert bytes1.limit() >= offset1 + length : "The first byte array isn't long enough ...
java
public static int compareSubArrays(ByteBuffer bytes1, int offset1, ByteBuffer bytes2, int offset2, int length) { if (bytes1 == null) return bytes2 == null ? 0 : -1; if (bytes2 == null) return 1; assert bytes1.limit() >= offset1 + length : "The first byte array isn't long enough ...
[ "public", "static", "int", "compareSubArrays", "(", "ByteBuffer", "bytes1", ",", "int", "offset1", ",", "ByteBuffer", "bytes2", ",", "int", "offset2", ",", "int", "length", ")", "{", "if", "(", "bytes1", "==", "null", ")", "return", "bytes2", "==", "null",...
Compare two ByteBuffer at specified offsets for length. Compares the non equal bytes as unsigned. @param bytes1 First byte buffer to compare. @param offset1 Position to start the comparison at in the first array. @param bytes2 Second byte buffer to compare. @param offset2 Position to start the comparison at in the seco...
[ "Compare", "two", "ByteBuffer", "at", "specified", "offsets", "for", "length", ".", "Compares", "the", "non", "equal", "bytes", "as", "unsigned", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/ByteBufferUtil.java#L472-L490
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/ByteBufferUtil.java
ByteBufferUtil.minimalBufferFor
public static ByteBuffer minimalBufferFor(ByteBuffer buf) { return buf.capacity() > buf.remaining() || !buf.hasArray() ? ByteBuffer.wrap(getArray(buf)) : buf; }
java
public static ByteBuffer minimalBufferFor(ByteBuffer buf) { return buf.capacity() > buf.remaining() || !buf.hasArray() ? ByteBuffer.wrap(getArray(buf)) : buf; }
[ "public", "static", "ByteBuffer", "minimalBufferFor", "(", "ByteBuffer", "buf", ")", "{", "return", "buf", ".", "capacity", "(", ")", ">", "buf", ".", "remaining", "(", ")", "||", "!", "buf", ".", "hasArray", "(", ")", "?", "ByteBuffer", ".", "wrap", "...
trims size of bytebuffer to exactly number of bytes in it, to do not hold too much memory
[ "trims", "size", "of", "bytebuffer", "to", "exactly", "number", "of", "bytes", "in", "it", "to", "do", "not", "hold", "too", "much", "memory" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/ByteBufferUtil.java#L513-L516
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/ByteBufferUtil.java
ByteBufferUtil.getShortLength
public static int getShortLength(ByteBuffer bb, int position) { int length = (bb.get(position) & 0xFF) << 8; return length | (bb.get(position + 1) & 0xFF); }
java
public static int getShortLength(ByteBuffer bb, int position) { int length = (bb.get(position) & 0xFF) << 8; return length | (bb.get(position + 1) & 0xFF); }
[ "public", "static", "int", "getShortLength", "(", "ByteBuffer", "bb", ",", "int", "position", ")", "{", "int", "length", "=", "(", "bb", ".", "get", "(", "position", ")", "&", "0xFF", ")", "<<", "8", ";", "return", "length", "|", "(", "bb", ".", "g...
Doesn't change bb position
[ "Doesn", "t", "change", "bb", "position" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/ByteBufferUtil.java#L519-L523
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/LocalStrategy.java
LocalStrategy.getNaturalEndpoints
@Override public ArrayList<InetAddress> getNaturalEndpoints(RingPosition searchPosition) { ArrayList<InetAddress> l = new ArrayList<InetAddress>(1); l.add(FBUtilities.getBroadcastAddress()); return l; }
java
@Override public ArrayList<InetAddress> getNaturalEndpoints(RingPosition searchPosition) { ArrayList<InetAddress> l = new ArrayList<InetAddress>(1); l.add(FBUtilities.getBroadcastAddress()); return l; }
[ "@", "Override", "public", "ArrayList", "<", "InetAddress", ">", "getNaturalEndpoints", "(", "RingPosition", "searchPosition", ")", "{", "ArrayList", "<", "InetAddress", ">", "l", "=", "new", "ArrayList", "<", "InetAddress", ">", "(", "1", ")", ";", "l", "."...
We need to override this even if we override calculateNaturalEndpoints, because the default implementation depends on token calculations but LocalStrategy may be used before tokens are set up.
[ "We", "need", "to", "override", "this", "even", "if", "we", "override", "calculateNaturalEndpoints", "because", "the", "default", "implementation", "depends", "on", "token", "calculations", "but", "LocalStrategy", "may", "be", "used", "before", "tokens", "are", "s...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/LocalStrategy.java#L44-L50
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.removeTruncationRecord
public static synchronized void removeTruncationRecord(UUID cfId) { String req = "DELETE truncated_at[?] from system.%s WHERE key = '%s'"; executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY), cfId); truncationRecords = null; forceBlockingFlush(LOCAL_CF); }
java
public static synchronized void removeTruncationRecord(UUID cfId) { String req = "DELETE truncated_at[?] from system.%s WHERE key = '%s'"; executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY), cfId); truncationRecords = null; forceBlockingFlush(LOCAL_CF); }
[ "public", "static", "synchronized", "void", "removeTruncationRecord", "(", "UUID", "cfId", ")", "{", "String", "req", "=", "\"DELETE truncated_at[?] from system.%s WHERE key = '%s'\"", ";", "executeInternal", "(", "String", ".", "format", "(", "req", ",", "LOCAL_CF", ...
This method is used to remove information about truncation time for specified column family
[ "This", "method", "is", "used", "to", "remove", "information", "about", "truncation", "time", "for", "specified", "column", "family" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L303-L309
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.updateTokens
public static synchronized void updateTokens(InetAddress ep, Collection<Token> tokens) { if (ep.equals(FBUtilities.getBroadcastAddress())) { removeEndpoint(ep); return; } String req = "INSERT INTO system.%s (peer, tokens) VALUES (?, ?)"; executeIntern...
java
public static synchronized void updateTokens(InetAddress ep, Collection<Token> tokens) { if (ep.equals(FBUtilities.getBroadcastAddress())) { removeEndpoint(ep); return; } String req = "INSERT INTO system.%s (peer, tokens) VALUES (?, ?)"; executeIntern...
[ "public", "static", "synchronized", "void", "updateTokens", "(", "InetAddress", "ep", ",", "Collection", "<", "Token", ">", "tokens", ")", "{", "if", "(", "ep", ".", "equals", "(", "FBUtilities", ".", "getBroadcastAddress", "(", ")", ")", ")", "{", "remove...
Record tokens being used by another node
[ "Record", "tokens", "being", "used", "by", "another", "node" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L377-L387
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.removeEndpoint
public static synchronized void removeEndpoint(InetAddress ep) { String req = "DELETE FROM system.%s WHERE peer = ?"; executeInternal(String.format(req, PEERS_CF), ep); }
java
public static synchronized void removeEndpoint(InetAddress ep) { String req = "DELETE FROM system.%s WHERE peer = ?"; executeInternal(String.format(req, PEERS_CF), ep); }
[ "public", "static", "synchronized", "void", "removeEndpoint", "(", "InetAddress", "ep", ")", "{", "String", "req", "=", "\"DELETE FROM system.%s WHERE peer = ?\"", ";", "executeInternal", "(", "String", ".", "format", "(", "req", ",", "PEERS_CF", ")", ",", "ep", ...
Remove stored tokens being used by another node
[ "Remove", "stored", "tokens", "being", "used", "by", "another", "node" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L439-L443
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.updateTokens
public static synchronized void updateTokens(Collection<Token> tokens) { assert !tokens.isEmpty() : "removeEndpoint should be used instead"; String req = "INSERT INTO system.%s (key, tokens) VALUES ('%s', ?)"; executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY), tokensAsSet(tokens)); ...
java
public static synchronized void updateTokens(Collection<Token> tokens) { assert !tokens.isEmpty() : "removeEndpoint should be used instead"; String req = "INSERT INTO system.%s (key, tokens) VALUES ('%s', ?)"; executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY), tokensAsSet(tokens)); ...
[ "public", "static", "synchronized", "void", "updateTokens", "(", "Collection", "<", "Token", ">", "tokens", ")", "{", "assert", "!", "tokens", ".", "isEmpty", "(", ")", ":", "\"removeEndpoint should be used instead\"", ";", "String", "req", "=", "\"INSERT INTO sys...
This method is used to update the System Keyspace with the new tokens for this node
[ "This", "method", "is", "used", "to", "update", "the", "System", "Keyspace", "with", "the", "new", "tokens", "for", "this", "node" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L448-L454
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.updateLocalTokens
public static synchronized Collection<Token> updateLocalTokens(Collection<Token> addTokens, Collection<Token> rmTokens) { Collection<Token> tokens = getSavedTokens(); tokens.removeAll(rmTokens); tokens.addAll(addTokens); updateTokens(tokens); return tokens; }
java
public static synchronized Collection<Token> updateLocalTokens(Collection<Token> addTokens, Collection<Token> rmTokens) { Collection<Token> tokens = getSavedTokens(); tokens.removeAll(rmTokens); tokens.addAll(addTokens); updateTokens(tokens); return tokens; }
[ "public", "static", "synchronized", "Collection", "<", "Token", ">", "updateLocalTokens", "(", "Collection", "<", "Token", ">", "addTokens", ",", "Collection", "<", "Token", ">", "rmTokens", ")", "{", "Collection", "<", "Token", ">", "tokens", "=", "getSavedTo...
Convenience method to update the list of tokens in the local system keyspace. @param addTokens tokens to add @param rmTokens tokens to remove @return the collection of persisted tokens
[ "Convenience", "method", "to", "update", "the", "list", "of", "tokens", "in", "the", "local", "system", "keyspace", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L463-L470
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.loadTokens
public static SetMultimap<InetAddress, Token> loadTokens() { SetMultimap<InetAddress, Token> tokenMap = HashMultimap.create(); for (UntypedResultSet.Row row : executeInternal("SELECT peer, tokens FROM system." + PEERS_CF)) { InetAddress peer = row.getInetAddress("peer"); ...
java
public static SetMultimap<InetAddress, Token> loadTokens() { SetMultimap<InetAddress, Token> tokenMap = HashMultimap.create(); for (UntypedResultSet.Row row : executeInternal("SELECT peer, tokens FROM system." + PEERS_CF)) { InetAddress peer = row.getInetAddress("peer"); ...
[ "public", "static", "SetMultimap", "<", "InetAddress", ",", "Token", ">", "loadTokens", "(", ")", "{", "SetMultimap", "<", "InetAddress", ",", "Token", ">", "tokenMap", "=", "HashMultimap", ".", "create", "(", ")", ";", "for", "(", "UntypedResultSet", ".", ...
Return a map of stored tokens to IP addresses
[ "Return", "a", "map", "of", "stored", "tokens", "to", "IP", "addresses" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L482-L493
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.loadHostIds
public static Map<InetAddress, UUID> loadHostIds() { Map<InetAddress, UUID> hostIdMap = new HashMap<InetAddress, UUID>(); for (UntypedResultSet.Row row : executeInternal("SELECT peer, host_id FROM system." + PEERS_CF)) { InetAddress peer = row.getInetAddress("peer"); ...
java
public static Map<InetAddress, UUID> loadHostIds() { Map<InetAddress, UUID> hostIdMap = new HashMap<InetAddress, UUID>(); for (UntypedResultSet.Row row : executeInternal("SELECT peer, host_id FROM system." + PEERS_CF)) { InetAddress peer = row.getInetAddress("peer"); ...
[ "public", "static", "Map", "<", "InetAddress", ",", "UUID", ">", "loadHostIds", "(", ")", "{", "Map", "<", "InetAddress", ",", "UUID", ">", "hostIdMap", "=", "new", "HashMap", "<", "InetAddress", ",", "UUID", ">", "(", ")", ";", "for", "(", "UntypedRes...
Return a map of store host_ids to IP addresses
[ "Return", "a", "map", "of", "store", "host_ids", "to", "IP", "addresses" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L499-L511
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.getPreferredIP
public static InetAddress getPreferredIP(InetAddress ep) { String req = "SELECT preferred_ip FROM system.%s WHERE peer=?"; UntypedResultSet result = executeInternal(String.format(req, PEERS_CF), ep); if (!result.isEmpty() && result.one().has("preferred_ip")) return result.one().g...
java
public static InetAddress getPreferredIP(InetAddress ep) { String req = "SELECT preferred_ip FROM system.%s WHERE peer=?"; UntypedResultSet result = executeInternal(String.format(req, PEERS_CF), ep); if (!result.isEmpty() && result.one().has("preferred_ip")) return result.one().g...
[ "public", "static", "InetAddress", "getPreferredIP", "(", "InetAddress", "ep", ")", "{", "String", "req", "=", "\"SELECT preferred_ip FROM system.%s WHERE peer=?\"", ";", "UntypedResultSet", "result", "=", "executeInternal", "(", "String", ".", "format", "(", "req", "...
Get preferred IP for given endpoint if it is known. Otherwise this returns given endpoint itself. @param ep endpoint address to check @return Preferred IP for given endpoint if present, otherwise returns given ep
[ "Get", "preferred", "IP", "for", "given", "endpoint", "if", "it", "is", "known", ".", "Otherwise", "this", "returns", "given", "endpoint", "itself", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L519-L526
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.loadDcRackInfo
public static Map<InetAddress, Map<String,String>> loadDcRackInfo() { Map<InetAddress, Map<String, String>> result = new HashMap<InetAddress, Map<String, String>>(); for (UntypedResultSet.Row row : executeInternal("SELECT peer, data_center, rack from system." + PEERS_CF)) { InetA...
java
public static Map<InetAddress, Map<String,String>> loadDcRackInfo() { Map<InetAddress, Map<String, String>> result = new HashMap<InetAddress, Map<String, String>>(); for (UntypedResultSet.Row row : executeInternal("SELECT peer, data_center, rack from system." + PEERS_CF)) { InetA...
[ "public", "static", "Map", "<", "InetAddress", ",", "Map", "<", "String", ",", "String", ">", ">", "loadDcRackInfo", "(", ")", "{", "Map", "<", "InetAddress", ",", "Map", "<", "String", ",", "String", ">", ">", "result", "=", "new", "HashMap", "<", "...
Return a map of IP addresses containing a map of dc and rack info
[ "Return", "a", "map", "of", "IP", "addresses", "containing", "a", "map", "of", "dc", "and", "rack", "info" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L531-L546
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.setLocalHostId
public static UUID setLocalHostId(UUID hostId) { String req = "INSERT INTO system.%s (key, host_id) VALUES ('%s', ?)"; executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY), hostId); return hostId; }
java
public static UUID setLocalHostId(UUID hostId) { String req = "INSERT INTO system.%s (key, host_id) VALUES ('%s', ?)"; executeInternal(String.format(req, LOCAL_CF, LOCAL_KEY), hostId); return hostId; }
[ "public", "static", "UUID", "setLocalHostId", "(", "UUID", "hostId", ")", "{", "String", "req", "=", "\"INSERT INTO system.%s (key, host_id) VALUES ('%s', ?)\"", ";", "executeInternal", "(", "String", ".", "format", "(", "req", ",", "LOCAL_CF", ",", "LOCAL_KEY", ")"...
Sets the local host ID explicitly. Should only be called outside of SystemTable when replacing a node.
[ "Sets", "the", "local", "host", "ID", "explicitly", ".", "Should", "only", "be", "called", "outside", "of", "SystemTable", "when", "replacing", "a", "node", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L712-L717
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.clearSSTableReadMeter
public static void clearSSTableReadMeter(String keyspace, String table, int generation) { String cql = "DELETE FROM system.%s WHERE keyspace_name=? AND columnfamily_name=? and generation=?"; executeInternal(String.format(cql, SSTABLE_ACTIVITY_CF), keyspace, table, generation); }
java
public static void clearSSTableReadMeter(String keyspace, String table, int generation) { String cql = "DELETE FROM system.%s WHERE keyspace_name=? AND columnfamily_name=? and generation=?"; executeInternal(String.format(cql, SSTABLE_ACTIVITY_CF), keyspace, table, generation); }
[ "public", "static", "void", "clearSSTableReadMeter", "(", "String", "keyspace", ",", "String", "table", ",", "int", "generation", ")", "{", "String", "cql", "=", "\"DELETE FROM system.%s WHERE keyspace_name=? AND columnfamily_name=? and generation=?\"", ";", "executeInternal"...
Clears persisted read rates from system.sstable_activity for SSTables that have been deleted.
[ "Clears", "persisted", "read", "rates", "from", "system", ".", "sstable_activity", "for", "SSTables", "that", "have", "been", "deleted", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L941-L945
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/SystemKeyspace.java
SystemKeyspace.updateSizeEstimates
public static void updateSizeEstimates(String keyspace, String table, Map<Range<Token>, Pair<Long, Long>> estimates) { long timestamp = FBUtilities.timestampMicros(); CFMetaData estimatesTable = CFMetaData.SizeEstimatesCf; Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, UTF8Type.instanc...
java
public static void updateSizeEstimates(String keyspace, String table, Map<Range<Token>, Pair<Long, Long>> estimates) { long timestamp = FBUtilities.timestampMicros(); CFMetaData estimatesTable = CFMetaData.SizeEstimatesCf; Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, UTF8Type.instanc...
[ "public", "static", "void", "updateSizeEstimates", "(", "String", "keyspace", ",", "String", "table", ",", "Map", "<", "Range", "<", "Token", ">", ",", "Pair", "<", "Long", ",", "Long", ">", ">", "estimates", ")", "{", "long", "timestamp", "=", "FBUtilit...
Writes the current partition count and size estimates into SIZE_ESTIMATES_CF
[ "Writes", "the", "current", "partition", "count", "and", "size", "estimates", "into", "SIZE_ESTIMATES_CF" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/SystemKeyspace.java#L950-L975
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/net/MessagingService.java
MessagingService.maybeAddLatency
public void maybeAddLatency(IAsyncCallback cb, InetAddress address, long latency) { if (cb.isLatencyForSnitch()) addLatency(address, latency); }
java
public void maybeAddLatency(IAsyncCallback cb, InetAddress address, long latency) { if (cb.isLatencyForSnitch()) addLatency(address, latency); }
[ "public", "void", "maybeAddLatency", "(", "IAsyncCallback", "cb", ",", "InetAddress", "address", ",", "long", "latency", ")", "{", "if", "(", "cb", ".", "isLatencyForSnitch", "(", ")", ")", "addLatency", "(", "address", ",", "latency", ")", ";", "}" ]
Track latency information for the dynamic snitch @param cb the callback associated with this message -- this lets us know if it's a message type we're interested in @param address the host that replied to the message @param latency
[ "Track", "latency", "information", "for", "the", "dynamic", "snitch" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/MessagingService.java#L385-L389
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/net/MessagingService.java
MessagingService.listen
public void listen(InetAddress localEp) throws ConfigurationException { callbacks.reset(); // hack to allow tests to stop/restart MS for (ServerSocket ss : getServerSockets(localEp)) { SocketThread th = new SocketThread(ss, "ACCEPT-" + localEp); th.start(); ...
java
public void listen(InetAddress localEp) throws ConfigurationException { callbacks.reset(); // hack to allow tests to stop/restart MS for (ServerSocket ss : getServerSockets(localEp)) { SocketThread th = new SocketThread(ss, "ACCEPT-" + localEp); th.start(); ...
[ "public", "void", "listen", "(", "InetAddress", "localEp", ")", "throws", "ConfigurationException", "{", "callbacks", ".", "reset", "(", ")", ";", "// hack to allow tests to stop/restart MS", "for", "(", "ServerSocket", "ss", ":", "getServerSockets", "(", "localEp", ...
Listen on the specified port. @param localEp InetAddress whose port to listen on.
[ "Listen", "on", "the", "specified", "port", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/MessagingService.java#L411-L421
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/net/MessagingService.java
MessagingService.registerVerbHandlers
public void registerVerbHandlers(Verb verb, IVerbHandler verbHandler) { assert !verbHandlers.containsKey(verb); verbHandlers.put(verb, verbHandler); }
java
public void registerVerbHandlers(Verb verb, IVerbHandler verbHandler) { assert !verbHandlers.containsKey(verb); verbHandlers.put(verb, verbHandler); }
[ "public", "void", "registerVerbHandlers", "(", "Verb", "verb", ",", "IVerbHandler", "verbHandler", ")", "{", "assert", "!", "verbHandlers", ".", "containsKey", "(", "verb", ")", ";", "verbHandlers", ".", "put", "(", "verb", ",", "verbHandler", ")", ";", "}" ...
Register a verb and the corresponding verb handler with the Messaging Service. @param verb @param verbHandler handler for the specified verb
[ "Register", "a", "verb", "and", "the", "corresponding", "verb", "handler", "with", "the", "Messaging", "Service", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/MessagingService.java#L540-L544
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/net/MessagingService.java
MessagingService.sendRR
public int sendRR(MessageOut message, InetAddress to, IAsyncCallback cb, long timeout, boolean failureCallback) { int id = addCallback(cb, message, to, timeout, failureCallback); sendOneWay(failureCallback ? message.withParameter(FAILURE_CALLBACK_PARAM, ONE_BYTE) : message, id, to); return i...
java
public int sendRR(MessageOut message, InetAddress to, IAsyncCallback cb, long timeout, boolean failureCallback) { int id = addCallback(cb, message, to, timeout, failureCallback); sendOneWay(failureCallback ? message.withParameter(FAILURE_CALLBACK_PARAM, ONE_BYTE) : message, id, to); return i...
[ "public", "int", "sendRR", "(", "MessageOut", "message", ",", "InetAddress", "to", ",", "IAsyncCallback", "cb", ",", "long", "timeout", ",", "boolean", "failureCallback", ")", "{", "int", "id", "=", "addCallback", "(", "cb", ",", "message", ",", "to", ",",...
Send a non-mutation message to a given endpoint. This method specifies a callback which is invoked with the actual response. @param message message to be sent. @param to endpoint to which the message needs to be sent @param cb callback interface which is used to pass the responses or suggest that a timeout o...
[ "Send", "a", "non", "-", "mutation", "message", "to", "a", "given", "endpoint", ".", "This", "method", "specifies", "a", "callback", "which", "is", "invoked", "with", "the", "actual", "response", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/MessagingService.java#L617-L622
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/net/MessagingService.java
MessagingService.sendOneWay
public void sendOneWay(MessageOut message, int id, InetAddress to) { if (logger.isTraceEnabled()) logger.trace(FBUtilities.getBroadcastAddress() + " sending " + message.verb + " to " + id + "@" + to); if (to.equals(FBUtilities.getBroadcastAddress())) logger.trace("Message-to...
java
public void sendOneWay(MessageOut message, int id, InetAddress to) { if (logger.isTraceEnabled()) logger.trace(FBUtilities.getBroadcastAddress() + " sending " + message.verb + " to " + id + "@" + to); if (to.equals(FBUtilities.getBroadcastAddress())) logger.trace("Message-to...
[ "public", "void", "sendOneWay", "(", "MessageOut", "message", ",", "int", "id", ",", "InetAddress", "to", ")", "{", "if", "(", "logger", ".", "isTraceEnabled", "(", ")", ")", "logger", ".", "trace", "(", "FBUtilities", ".", "getBroadcastAddress", "(", ")",...
Send a message to a given endpoint. This method adheres to the fire and forget style messaging. @param message messages to be sent. @param to endpoint to which the message needs to be sent
[ "Send", "a", "message", "to", "a", "given", "endpoint", ".", "This", "method", "adheres", "to", "the", "fire", "and", "forget", "style", "messaging", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/MessagingService.java#L663-L683
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java
ColumnNameHelper.min
private static ByteBuffer min(ByteBuffer b1, ByteBuffer b2, AbstractType<?> comparator) { if (b1 == null) return b2; if (b2 == null) return b1; if (comparator.compare(b1, b2) >= 0) return b2; return b1; }
java
private static ByteBuffer min(ByteBuffer b1, ByteBuffer b2, AbstractType<?> comparator) { if (b1 == null) return b2; if (b2 == null) return b1; if (comparator.compare(b1, b2) >= 0) return b2; return b1; }
[ "private", "static", "ByteBuffer", "min", "(", "ByteBuffer", "b1", ",", "ByteBuffer", "b2", ",", "AbstractType", "<", "?", ">", "comparator", ")", "{", "if", "(", "b1", "==", "null", ")", "return", "b2", ";", "if", "(", "b2", "==", "null", ")", "retu...
return the min column note that comparator should not be of CompositeType! @param b1 lhs @param b2 rhs @param comparator the comparator to use @return the smallest column according to comparator
[ "return", "the", "min", "column" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java#L119-L129
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java
ColumnNameHelper.max
private static ByteBuffer max(ByteBuffer b1, ByteBuffer b2, AbstractType<?> comparator) { if (b1 == null) return b2; if (b2 == null) return b1; if (comparator.compare(b1, b2) >= 0) return b1; return b2; }
java
private static ByteBuffer max(ByteBuffer b1, ByteBuffer b2, AbstractType<?> comparator) { if (b1 == null) return b2; if (b2 == null) return b1; if (comparator.compare(b1, b2) >= 0) return b1; return b2; }
[ "private", "static", "ByteBuffer", "max", "(", "ByteBuffer", "b1", ",", "ByteBuffer", "b2", ",", "AbstractType", "<", "?", ">", "comparator", ")", "{", "if", "(", "b1", "==", "null", ")", "return", "b2", ";", "if", "(", "b2", "==", "null", ")", "retu...
return the max column note that comparator should not be of CompositeType! @param b1 lhs @param b2 rhs @param comparator the comparator to use @return the biggest column according to comparator
[ "return", "the", "max", "column" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java#L141-L151
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java
ColumnNameHelper.mergeMin
public static List<ByteBuffer> mergeMin(List<ByteBuffer> minColumnNames, List<ByteBuffer> candidates, CellNameType comparator) { if (minColumnNames.isEmpty()) return minimalBuffersFor(candidates); if (candidates.isEmpty()) return minColumnNames; List<ByteBuffer> big...
java
public static List<ByteBuffer> mergeMin(List<ByteBuffer> minColumnNames, List<ByteBuffer> candidates, CellNameType comparator) { if (minColumnNames.isEmpty()) return minimalBuffersFor(candidates); if (candidates.isEmpty()) return minColumnNames; List<ByteBuffer> big...
[ "public", "static", "List", "<", "ByteBuffer", ">", "mergeMin", "(", "List", "<", "ByteBuffer", ">", "minColumnNames", ",", "List", "<", "ByteBuffer", ">", "candidates", ",", "CellNameType", "comparator", ")", "{", "if", "(", "minColumnNames", ".", "isEmpty", ...
Merge 2 lists of min cell name components. @param minColumnNames lhs @param candidates rhs @param comparator comparator to use @return a list with smallest column names according to (sub)comparator
[ "Merge", "2", "lists", "of", "min", "cell", "name", "components", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java#L161-L181
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java
ColumnNameHelper.mergeMax
public static List<ByteBuffer> mergeMax(List<ByteBuffer> maxColumnNames, List<ByteBuffer> candidates, CellNameType comparator) { if (maxColumnNames.isEmpty()) return minimalBuffersFor(candidates); if (candidates.isEmpty()) return maxColumnNames; List<ByteBuffer> big...
java
public static List<ByteBuffer> mergeMax(List<ByteBuffer> maxColumnNames, List<ByteBuffer> candidates, CellNameType comparator) { if (maxColumnNames.isEmpty()) return minimalBuffersFor(candidates); if (candidates.isEmpty()) return maxColumnNames; List<ByteBuffer> big...
[ "public", "static", "List", "<", "ByteBuffer", ">", "mergeMax", "(", "List", "<", "ByteBuffer", ">", "maxColumnNames", ",", "List", "<", "ByteBuffer", ">", "candidates", ",", "CellNameType", "comparator", ")", "{", "if", "(", "maxColumnNames", ".", "isEmpty", ...
Merge 2 lists of max cell name components. @param maxColumnNames lhs @param candidates rhs @param comparator comparator to use @return a list with biggest column names according to (sub)comparator
[ "Merge", "2", "lists", "of", "max", "cell", "name", "components", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/ColumnNameHelper.java#L199-L219
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/BufferCounterCell.java
BufferCounterCell.createLocal
public static CounterCell createLocal(CellName name, long value, long timestamp, long timestampOfLastDelete) { return new BufferCounterCell(name, contextManager.createLocal(value), timestamp, timestampOfLastDelete); }
java
public static CounterCell createLocal(CellName name, long value, long timestamp, long timestampOfLastDelete) { return new BufferCounterCell(name, contextManager.createLocal(value), timestamp, timestampOfLastDelete); }
[ "public", "static", "CounterCell", "createLocal", "(", "CellName", "name", ",", "long", "value", ",", "long", "timestamp", ",", "long", "timestampOfLastDelete", ")", "{", "return", "new", "BufferCounterCell", "(", "name", ",", "contextManager", ".", "createLocal",...
For use by tests of compatibility with pre-2.1 counter only.
[ "For", "use", "by", "tests", "of", "compatibility", "with", "pre", "-", "2", ".", "1", "counter", "only", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/BufferCounterCell.java#L55-L58
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/tools/SSTableImport.java
SSTableImport.addColumnsToCF
private void addColumnsToCF(List<?> row, ColumnFamily cfamily) { CFMetaData cfm = cfamily.metadata(); assert cfm != null; for (Object c : row) { JsonColumn col = new JsonColumn<List>((List) c, cfm); if (col.isRangeTombstone()) { Co...
java
private void addColumnsToCF(List<?> row, ColumnFamily cfamily) { CFMetaData cfm = cfamily.metadata(); assert cfm != null; for (Object c : row) { JsonColumn col = new JsonColumn<List>((List) c, cfm); if (col.isRangeTombstone()) { Co...
[ "private", "void", "addColumnsToCF", "(", "List", "<", "?", ">", "row", ",", "ColumnFamily", "cfamily", ")", "{", "CFMetaData", "cfm", "=", "cfamily", ".", "metadata", "(", ")", ";", "assert", "cfm", "!=", "null", ";", "for", "(", "Object", "c", ":", ...
Add columns to a column family. @param row the columns associated with a row @param cfamily the column family to add columns to
[ "Add", "columns", "to", "a", "column", "family", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableImport.java#L206-L253
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/tools/SSTableImport.java
SSTableImport.importJson
public int importJson(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException { ColumnFamily columnFamily = ArrayBackedSortedColumns.factory.create(keyspace, cf); IPartitioner partitioner = DatabaseDescriptor.getPartitioner(); int importedKeys = (isSorted) ? impo...
java
public int importJson(String jsonFile, String keyspace, String cf, String ssTablePath) throws IOException { ColumnFamily columnFamily = ArrayBackedSortedColumns.factory.create(keyspace, cf); IPartitioner partitioner = DatabaseDescriptor.getPartitioner(); int importedKeys = (isSorted) ? impo...
[ "public", "int", "importJson", "(", "String", "jsonFile", ",", "String", "keyspace", ",", "String", "cf", ",", "String", "ssTablePath", ")", "throws", "IOException", "{", "ColumnFamily", "columnFamily", "=", "ArrayBackedSortedColumns", ".", "factory", ".", "create...
Convert a JSON formatted file to an SSTable. @param jsonFile the file containing JSON formatted data @param keyspace keyspace the data belongs to @param cf column family the data belongs to @param ssTablePath file to write the SSTable to @throws IOException for errors reading/writing input/output
[ "Convert", "a", "JSON", "formatted", "file", "to", "an", "SSTable", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableImport.java#L282-L294
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/tools/SSTableImport.java
SSTableImport.getKeyValidator
private AbstractType<?> getKeyValidator(ColumnFamily columnFamily) { // this is a fix to support backward compatibility // which allows to skip the current key validator // please, take a look onto CASSANDRA-7498 for more details if ("true".equals(System.getProperty("skip.key.validator",...
java
private AbstractType<?> getKeyValidator(ColumnFamily columnFamily) { // this is a fix to support backward compatibility // which allows to skip the current key validator // please, take a look onto CASSANDRA-7498 for more details if ("true".equals(System.getProperty("skip.key.validator",...
[ "private", "AbstractType", "<", "?", ">", "getKeyValidator", "(", "ColumnFamily", "columnFamily", ")", "{", "// this is a fix to support backward compatibility", "// which allows to skip the current key validator", "// please, take a look onto CASSANDRA-7498 for more details", "if", "(...
Get key validator for column family @param columnFamily column family instance @return key validator for given column family
[ "Get", "key", "validator", "for", "column", "family" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableImport.java#L435-L443
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/tools/SSTableImport.java
SSTableImport.main
public static void main(String[] args) throws ParseException, ConfigurationException { CommandLineParser parser = new PosixParser(); try { cmd = parser.parse(options, args); } catch (org.apache.commons.cli.ParseException e) { System.err.printl...
java
public static void main(String[] args) throws ParseException, ConfigurationException { CommandLineParser parser = new PosixParser(); try { cmd = parser.parse(options, args); } catch (org.apache.commons.cli.ParseException e) { System.err.printl...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "ParseException", ",", "ConfigurationException", "{", "CommandLineParser", "parser", "=", "new", "PosixParser", "(", ")", ";", "try", "{", "cmd", "=", "parser", ".", "parse",...
Converts JSON to an SSTable file. JSON input can either be a file specified using an optional command line argument, or supplied on standard in. @param args command line arguments @throws IOException on failure to open/read/write files or output streams @throws ParseException on failure to parse JSON input @throws Con...
[ "Converts", "JSON", "to", "an", "SSTable", "file", ".", "JSON", "input", "can", "either", "be", "a", "file", "specified", "using", "an", "optional", "command", "line", "argument", "or", "supplied", "on", "standard", "in", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableImport.java#L465-L525
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.updateHostId
public void updateHostId(UUID hostId, InetAddress endpoint) { assert hostId != null; assert endpoint != null; lock.writeLock().lock(); try { InetAddress storedEp = endpointToHostIdMap.inverse().get(hostId); if (storedEp != null) { ...
java
public void updateHostId(UUID hostId, InetAddress endpoint) { assert hostId != null; assert endpoint != null; lock.writeLock().lock(); try { InetAddress storedEp = endpointToHostIdMap.inverse().get(hostId); if (storedEp != null) { ...
[ "public", "void", "updateHostId", "(", "UUID", "hostId", ",", "InetAddress", "endpoint", ")", "{", "assert", "hostId", "!=", "null", ";", "assert", "endpoint", "!=", "null", ";", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{...
Store an end-point to host ID mapping. Each ID must be unique, and cannot be changed after the fact. @param hostId @param endpoint
[ "Store", "an", "end", "-", "point", "to", "host", "ID", "mapping", ".", "Each", "ID", "must", "be", "unique", "and", "cannot", "be", "changed", "after", "the", "fact", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L220-L251
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.getHostId
public UUID getHostId(InetAddress endpoint) { lock.readLock().lock(); try { return endpointToHostIdMap.get(endpoint); } finally { lock.readLock().unlock(); } }
java
public UUID getHostId(InetAddress endpoint) { lock.readLock().lock(); try { return endpointToHostIdMap.get(endpoint); } finally { lock.readLock().unlock(); } }
[ "public", "UUID", "getHostId", "(", "InetAddress", "endpoint", ")", "{", "lock", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "return", "endpointToHostIdMap", ".", "get", "(", "endpoint", ")", ";", "}", "finally", "{", "lock", "."...
Return the unique host ID for an end-point.
[ "Return", "the", "unique", "host", "ID", "for", "an", "end", "-", "point", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L254-L265
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.getEndpointForHostId
public InetAddress getEndpointForHostId(UUID hostId) { lock.readLock().lock(); try { return endpointToHostIdMap.inverse().get(hostId); } finally { lock.readLock().unlock(); } }
java
public InetAddress getEndpointForHostId(UUID hostId) { lock.readLock().lock(); try { return endpointToHostIdMap.inverse().get(hostId); } finally { lock.readLock().unlock(); } }
[ "public", "InetAddress", "getEndpointForHostId", "(", "UUID", "hostId", ")", "{", "lock", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "return", "endpointToHostIdMap", ".", "inverse", "(", ")", ".", "get", "(", "hostId", ")", ";", ...
Return the end-point for a unique host ID
[ "Return", "the", "end", "-", "point", "for", "a", "unique", "host", "ID" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L268-L279
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.addMovingEndpoint
public void addMovingEndpoint(Token token, InetAddress endpoint) { assert endpoint != null; lock.writeLock().lock(); try { movingEndpoints.add(Pair.create(token, endpoint)); } finally { lock.writeLock().unlock(); } }
java
public void addMovingEndpoint(Token token, InetAddress endpoint) { assert endpoint != null; lock.writeLock().lock(); try { movingEndpoints.add(Pair.create(token, endpoint)); } finally { lock.writeLock().unlock(); } }
[ "public", "void", "addMovingEndpoint", "(", "Token", "token", ",", "InetAddress", "endpoint", ")", "{", "assert", "endpoint", "!=", "null", ";", "lock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "movingEndpoints", ".", "add", "(...
Add a new moving endpoint @param token token which is node moving to @param endpoint address of the moving node
[ "Add", "a", "new", "moving", "endpoint" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L372-L386
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.cloneOnlyTokenMap
public TokenMetadata cloneOnlyTokenMap() { lock.readLock().lock(); try { return new TokenMetadata(SortedBiMultiValMap.<Token, InetAddress>create(tokenToEndpointMap, null, inetaddressCmp), HashBiMap.create(endpointToHostIdMap), ...
java
public TokenMetadata cloneOnlyTokenMap() { lock.readLock().lock(); try { return new TokenMetadata(SortedBiMultiValMap.<Token, InetAddress>create(tokenToEndpointMap, null, inetaddressCmp), HashBiMap.create(endpointToHostIdMap), ...
[ "public", "TokenMetadata", "cloneOnlyTokenMap", "(", ")", "{", "lock", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "return", "new", "TokenMetadata", "(", "SortedBiMultiValMap", ".", "<", "Token", ",", "InetAddress", ">", "create", "(...
Create a copy of TokenMetadata with only tokenToEndpointMap. That is, pending ranges, bootstrap tokens and leaving endpoints are not included in the copy.
[ "Create", "a", "copy", "of", "TokenMetadata", "with", "only", "tokenToEndpointMap", ".", "That", "is", "pending", "ranges", "bootstrap", "tokens", "and", "leaving", "endpoints", "are", "not", "included", "in", "the", "copy", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L517-L530
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.cachedOnlyTokenMap
public TokenMetadata cachedOnlyTokenMap() { TokenMetadata tm = cachedTokenMap.get(); if (tm != null) return tm; // synchronize to prevent thundering herd (CASSANDRA-6345) synchronized (this) { if ((tm = cachedTokenMap.get()) != null) r...
java
public TokenMetadata cachedOnlyTokenMap() { TokenMetadata tm = cachedTokenMap.get(); if (tm != null) return tm; // synchronize to prevent thundering herd (CASSANDRA-6345) synchronized (this) { if ((tm = cachedTokenMap.get()) != null) r...
[ "public", "TokenMetadata", "cachedOnlyTokenMap", "(", ")", "{", "TokenMetadata", "tm", "=", "cachedTokenMap", ".", "get", "(", ")", ";", "if", "(", "tm", "!=", "null", ")", "return", "tm", ";", "// synchronize to prevent thundering herd (CASSANDRA-6345)", "synchroni...
Return a cached TokenMetadata with only tokenToEndpointMap, i.e., the same as cloneOnlyTokenMap but uses a cached copy that is invalided when the ring changes, so in the common case no extra locking is required. Callers must *NOT* mutate the returned metadata object.
[ "Return", "a", "cached", "TokenMetadata", "with", "only", "tokenToEndpointMap", "i", ".", "e", ".", "the", "same", "as", "cloneOnlyTokenMap", "but", "uses", "a", "cached", "copy", "that", "is", "invalided", "when", "the", "ring", "changes", "so", "in", "the"...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L539-L555
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.cloneAfterAllLeft
public TokenMetadata cloneAfterAllLeft() { lock.readLock().lock(); try { TokenMetadata allLeftMetadata = cloneOnlyTokenMap(); for (InetAddress endpoint : leavingEndpoints) allLeftMetadata.removeEndpoint(endpoint); return allLeftMetadata; ...
java
public TokenMetadata cloneAfterAllLeft() { lock.readLock().lock(); try { TokenMetadata allLeftMetadata = cloneOnlyTokenMap(); for (InetAddress endpoint : leavingEndpoints) allLeftMetadata.removeEndpoint(endpoint); return allLeftMetadata; ...
[ "public", "TokenMetadata", "cloneAfterAllLeft", "(", ")", "{", "lock", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "TokenMetadata", "allLeftMetadata", "=", "cloneOnlyTokenMap", "(", ")", ";", "for", "(", "InetAddress", "endpoint", ":",...
Create a copy of TokenMetadata with tokenToEndpointMap reflecting situation after all current leave operations have finished. @return new token metadata
[ "Create", "a", "copy", "of", "TokenMetadata", "with", "tokenToEndpointMap", "reflecting", "situation", "after", "all", "current", "leave", "operations", "have", "finished", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L563-L579
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/locator/TokenMetadata.java
TokenMetadata.cloneAfterAllSettled
public TokenMetadata cloneAfterAllSettled() { lock.readLock().lock(); try { TokenMetadata metadata = cloneOnlyTokenMap(); for (InetAddress endpoint : leavingEndpoints) metadata.removeEndpoint(endpoint); for (Pair<Token, InetAddress> pai...
java
public TokenMetadata cloneAfterAllSettled() { lock.readLock().lock(); try { TokenMetadata metadata = cloneOnlyTokenMap(); for (InetAddress endpoint : leavingEndpoints) metadata.removeEndpoint(endpoint); for (Pair<Token, InetAddress> pai...
[ "public", "TokenMetadata", "cloneAfterAllSettled", "(", ")", "{", "lock", ".", "readLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "TokenMetadata", "metadata", "=", "cloneOnlyTokenMap", "(", ")", ";", "for", "(", "InetAddress", "endpoint", ":", "...
Create a copy of TokenMetadata with tokenToEndpointMap reflecting situation after all current leave, and move operations have finished. @return new token metadata
[ "Create", "a", "copy", "of", "TokenMetadata", "with", "tokenToEndpointMap", "reflecting", "situation", "after", "all", "current", "leave", "and", "move", "operations", "have", "finished", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/locator/TokenMetadata.java#L587-L608
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/metrics/RestorableMeter.java
RestorableMeter.tickIfNecessary
private void tickIfNecessary() { final long oldTick = lastTick.get(); final long newTick = clock.tick(); final long age = newTick - oldTick; if (age > TICK_INTERVAL) { final long newIntervalStartTick = newTick - age % TICK_INTERVAL; if (lastTick.compareAndSet(oldT...
java
private void tickIfNecessary() { final long oldTick = lastTick.get(); final long newTick = clock.tick(); final long age = newTick - oldTick; if (age > TICK_INTERVAL) { final long newIntervalStartTick = newTick - age % TICK_INTERVAL; if (lastTick.compareAndSet(oldT...
[ "private", "void", "tickIfNecessary", "(", ")", "{", "final", "long", "oldTick", "=", "lastTick", ".", "get", "(", ")", ";", "final", "long", "newTick", "=", "clock", ".", "tick", "(", ")", ";", "final", "long", "age", "=", "newTick", "-", "oldTick", ...
Updates the moving averages as needed.
[ "Updates", "the", "moving", "averages", "as", "needed", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/metrics/RestorableMeter.java#L74-L88
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/TopKSampler.java
TopKSampler.beginSampling
public synchronized void beginSampling(int capacity) { if (!enabled) { summary = new StreamSummary<T>(capacity); hll = new HyperLogLogPlus(14); enabled = true; } }
java
public synchronized void beginSampling(int capacity) { if (!enabled) { summary = new StreamSummary<T>(capacity); hll = new HyperLogLogPlus(14); enabled = true; } }
[ "public", "synchronized", "void", "beginSampling", "(", "int", "capacity", ")", "{", "if", "(", "!", "enabled", ")", "{", "summary", "=", "new", "StreamSummary", "<", "T", ">", "(", "capacity", ")", ";", "hll", "=", "new", "HyperLogLogPlus", "(", "14", ...
Start to record samples @param capacity Number of sample items to keep in memory, the lower this is the less accurate results are. For best results use value close to cardinality, but understand the memory trade offs.
[ "Start", "to", "record", "samples" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/TopKSampler.java#L55-L63
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/TopKSampler.java
TopKSampler.finishSampling
public synchronized SamplerResult<T> finishSampling(int count) { List<Counter<T>> results = Collections.EMPTY_LIST; long cardinality = 0; if (enabled) { enabled = false; results = summary.topK(count); cardinality = hll.cardinality(); } ...
java
public synchronized SamplerResult<T> finishSampling(int count) { List<Counter<T>> results = Collections.EMPTY_LIST; long cardinality = 0; if (enabled) { enabled = false; results = summary.topK(count); cardinality = hll.cardinality(); } ...
[ "public", "synchronized", "SamplerResult", "<", "T", ">", "finishSampling", "(", "int", "count", ")", "{", "List", "<", "Counter", "<", "T", ">>", "results", "=", "Collections", ".", "EMPTY_LIST", ";", "long", "cardinality", "=", "0", ";", "if", "(", "en...
Call to stop collecting samples, and gather the results @param count Number of most frequent items to return
[ "Call", "to", "stop", "collecting", "samples", "and", "gather", "the", "results" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/TopKSampler.java#L69-L80
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/TopKSampler.java
TopKSampler.addSample
public void addSample(final T item, final long hash, final int value) { if (enabled) { final Object lock = this; samplerExecutor.execute(new Runnable() { public void run() { // samplerExecutor is single threaded ...
java
public void addSample(final T item, final long hash, final int value) { if (enabled) { final Object lock = this; samplerExecutor.execute(new Runnable() { public void run() { // samplerExecutor is single threaded ...
[ "public", "void", "addSample", "(", "final", "T", "item", ",", "final", "long", "hash", ",", "final", "int", "value", ")", "{", "if", "(", "enabled", ")", "{", "final", "Object", "lock", "=", "this", ";", "samplerExecutor", ".", "execute", "(", "new", ...
Adds a sample to statistics collection. This method is non-blocking and will use the "Sampler" thread pool to record results if the sampler is enabled. If not sampling this is a NOOP
[ "Adds", "a", "sample", "to", "statistics", "collection", ".", "This", "method", "is", "non", "-", "blocking", "and", "will", "use", "the", "Sampler", "thread", "pool", "to", "record", "results", "if", "the", "sampler", "is", "enabled", ".", "If", "not", ...
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/TopKSampler.java#L92-L120
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java
CqlNativeStorage.getNext
public Tuple getNext() throws IOException { try { // load the next pair if (!reader.nextKeyValue()) return null; CfInfo cfInfo = getCfInfo(loadSignature); CfDef cfDef = cfInfo.cfDef; Row row = reader.getCurrentValue(); ...
java
public Tuple getNext() throws IOException { try { // load the next pair if (!reader.nextKeyValue()) return null; CfInfo cfInfo = getCfInfo(loadSignature); CfDef cfDef = cfInfo.cfDef; Row row = reader.getCurrentValue(); ...
[ "public", "Tuple", "getNext", "(", ")", "throws", "IOException", "{", "try", "{", "// load the next pair", "if", "(", "!", "reader", ".", "nextKeyValue", "(", ")", ")", "return", "null", ";", "CfInfo", "cfInfo", "=", "getCfInfo", "(", "loadSignature", ")", ...
get next row
[ "get", "next", "row" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L114-L148
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java
CqlNativeStorage.cqlColumnToObj
private Object cqlColumnToObj(Cell col, CfDef cfDef) throws IOException { // standard Map<ByteBuffer,AbstractType> validators = getValidatorMap(cfDef); ByteBuffer cellName = col.name().toByteBuffer(); if (validators.get(cellName) == null) return cassandraToObj(getDefaultM...
java
private Object cqlColumnToObj(Cell col, CfDef cfDef) throws IOException { // standard Map<ByteBuffer,AbstractType> validators = getValidatorMap(cfDef); ByteBuffer cellName = col.name().toByteBuffer(); if (validators.get(cellName) == null) return cassandraToObj(getDefaultM...
[ "private", "Object", "cqlColumnToObj", "(", "Cell", "col", ",", "CfDef", "cfDef", ")", "throws", "IOException", "{", "// standard", "Map", "<", "ByteBuffer", ",", "AbstractType", ">", "validators", "=", "getValidatorMap", "(", "cfDef", ")", ";", "ByteBuffer", ...
convert a cql column to an object
[ "convert", "a", "cql", "column", "to", "an", "object" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L151-L160
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java
CqlNativeStorage.getColumnMetadata
protected List<ColumnDef> getColumnMetadata(Cassandra.Client client) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException, CharacterCodingException, org.apache.cassandra.except...
java
protected List<ColumnDef> getColumnMetadata(Cassandra.Client client) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException, CharacterCodingException, org.apache.cassandra.except...
[ "protected", "List", "<", "ColumnDef", ">", "getColumnMetadata", "(", "Cassandra", ".", "Client", "client", ")", "throws", "InvalidRequestException", ",", "UnavailableException", ",", "TimedOutException", ",", "SchemaDisagreementException", ",", "TException", ",", "Char...
include key columns
[ "include", "key", "columns" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L224-L254
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java
CqlNativeStorage.tupleToKeyMap
private Map<String, ByteBuffer> tupleToKeyMap(Tuple t) throws IOException { Map<String, ByteBuffer> keys = new HashMap<String, ByteBuffer>(); for (int i = 0; i < t.size(); i++) { if (t.getType(i) == DataType.TUPLE) { Tuple inner = (Tuple) t.get(i); ...
java
private Map<String, ByteBuffer> tupleToKeyMap(Tuple t) throws IOException { Map<String, ByteBuffer> keys = new HashMap<String, ByteBuffer>(); for (int i = 0; i < t.size(); i++) { if (t.getType(i) == DataType.TUPLE) { Tuple inner = (Tuple) t.get(i); ...
[ "private", "Map", "<", "String", ",", "ByteBuffer", ">", "tupleToKeyMap", "(", "Tuple", "t", ")", "throws", "IOException", "{", "Map", "<", "String", ",", "ByteBuffer", ">", "keys", "=", "new", "HashMap", "<", "String", ",", "ByteBuffer", ">", "(", ")", ...
convert key tuple to key map
[ "convert", "key", "tuple", "to", "key", "map" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L415-L442
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java
CqlNativeStorage.cqlQueryFromTuple
private void cqlQueryFromTuple(Map<String, ByteBuffer> key, Tuple t, int offset) throws IOException { for (int i = offset; i < t.size(); i++) { if (t.getType(i) == DataType.TUPLE) { Tuple inner = (Tuple) t.get(i); if (inner.size() > 0) ...
java
private void cqlQueryFromTuple(Map<String, ByteBuffer> key, Tuple t, int offset) throws IOException { for (int i = offset; i < t.size(); i++) { if (t.getType(i) == DataType.TUPLE) { Tuple inner = (Tuple) t.get(i); if (inner.size() > 0) ...
[ "private", "void", "cqlQueryFromTuple", "(", "Map", "<", "String", ",", "ByteBuffer", ">", "key", ",", "Tuple", "t", ",", "int", "offset", ")", "throws", "IOException", "{", "for", "(", "int", "i", "=", "offset", ";", "i", "<", "t", ".", "size", "(",...
send CQL query request using data from tuple
[ "send", "CQL", "query", "request", "using", "data", "from", "tuple" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L445-L466
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java
CqlNativeStorage.bindedVariablesFromTuple
private List<ByteBuffer> bindedVariablesFromTuple(Tuple t) throws IOException { List<ByteBuffer> variables = new ArrayList<ByteBuffer>(); for (int i = 0; i < t.size(); i++) variables.add(objToBB(t.get(i))); return variables; }
java
private List<ByteBuffer> bindedVariablesFromTuple(Tuple t) throws IOException { List<ByteBuffer> variables = new ArrayList<ByteBuffer>(); for (int i = 0; i < t.size(); i++) variables.add(objToBB(t.get(i))); return variables; }
[ "private", "List", "<", "ByteBuffer", ">", "bindedVariablesFromTuple", "(", "Tuple", "t", ")", "throws", "IOException", "{", "List", "<", "ByteBuffer", ">", "variables", "=", "new", "ArrayList", "<", "ByteBuffer", ">", "(", ")", ";", "for", "(", "int", "i"...
compose a list of binded variables
[ "compose", "a", "list", "of", "binded", "variables" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L469-L475
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java
CqlNativeStorage.sendCqlQuery
private void sendCqlQuery(Map<String, ByteBuffer> key, List<ByteBuffer> bindedVariables) throws IOException { try { writer.write(key, bindedVariables); } catch (InterruptedException e) { throw new IOException(e); } }
java
private void sendCqlQuery(Map<String, ByteBuffer> key, List<ByteBuffer> bindedVariables) throws IOException { try { writer.write(key, bindedVariables); } catch (InterruptedException e) { throw new IOException(e); } }
[ "private", "void", "sendCqlQuery", "(", "Map", "<", "String", ",", "ByteBuffer", ">", "key", ",", "List", "<", "ByteBuffer", ">", "bindedVariables", ")", "throws", "IOException", "{", "try", "{", "writer", ".", "write", "(", "key", ",", "bindedVariables", ...
writer write the data by executing CQL query
[ "writer", "write", "the", "data", "by", "executing", "CQL", "query" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L478-L488
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java
CqlNativeStorage.getWhereClauseForPartitionFilter
private String getWhereClauseForPartitionFilter() { UDFContext context = UDFContext.getUDFContext(); Properties property = context.getUDFProperties(AbstractCassandraStorage.class); return property.getProperty(PARTITION_FILTER_SIGNATURE); }
java
private String getWhereClauseForPartitionFilter() { UDFContext context = UDFContext.getUDFContext(); Properties property = context.getUDFProperties(AbstractCassandraStorage.class); return property.getProperty(PARTITION_FILTER_SIGNATURE); }
[ "private", "String", "getWhereClauseForPartitionFilter", "(", ")", "{", "UDFContext", "context", "=", "UDFContext", ".", "getUDFContext", "(", ")", ";", "Properties", "property", "=", "context", ".", "getUDFProperties", "(", "AbstractCassandraStorage", ".", "class", ...
retrieve where clause for partition filter
[ "retrieve", "where", "clause", "for", "partition", "filter" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/pig/CqlNativeStorage.java#L557-L562
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/dht/AbstractByteOrderedPartitioner.java
AbstractByteOrderedPartitioner.bigForBytes
private BigInteger bigForBytes(byte[] bytes, int sigbytes) { byte[] b; if (sigbytes != bytes.length) { b = new byte[sigbytes]; System.arraycopy(bytes, 0, b, 0, bytes.length); } else b = bytes; return new BigInteger(1, b); }
java
private BigInteger bigForBytes(byte[] bytes, int sigbytes) { byte[] b; if (sigbytes != bytes.length) { b = new byte[sigbytes]; System.arraycopy(bytes, 0, b, 0, bytes.length); } else b = bytes; return new BigInteger(1, b); }
[ "private", "BigInteger", "bigForBytes", "(", "byte", "[", "]", "bytes", ",", "int", "sigbytes", ")", "{", "byte", "[", "]", "b", ";", "if", "(", "sigbytes", "!=", "bytes", ".", "length", ")", "{", "b", "=", "new", "byte", "[", "sigbytes", "]", ";",...
Convert a byte array containing the most significant of 'sigbytes' bytes representing a big-endian magnitude into a BigInteger.
[ "Convert", "a", "byte", "array", "containing", "the", "most", "significant", "of", "sigbytes", "bytes", "representing", "a", "big", "-", "endian", "magnitude", "into", "a", "BigInteger", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/dht/AbstractByteOrderedPartitioner.java#L65-L75
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/concurrent/StageManager.java
StageManager.shutdownNow
public static void shutdownNow() { for (Stage stage : Stage.values()) { StageManager.stages.get(stage).shutdownNow(); } }
java
public static void shutdownNow() { for (Stage stage : Stage.values()) { StageManager.stages.get(stage).shutdownNow(); } }
[ "public", "static", "void", "shutdownNow", "(", ")", "{", "for", "(", "Stage", "stage", ":", "Stage", ".", "values", "(", ")", ")", "{", "StageManager", ".", "stages", ".", "get", "(", "stage", ")", ".", "shutdownNow", "(", ")", ";", "}", "}" ]
This method shuts down all registered stages.
[ "This", "method", "shuts", "down", "all", "registered", "stages", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/StageManager.java#L107-L113
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/FBUtilities.java
FBUtilities.midpoint
public static Pair<BigInteger,Boolean> midpoint(BigInteger left, BigInteger right, int sigbits) { BigInteger midpoint; boolean remainder; if (left.compareTo(right) < 0) { BigInteger sum = left.add(right); remainder = sum.testBit(0); midpoint = sum....
java
public static Pair<BigInteger,Boolean> midpoint(BigInteger left, BigInteger right, int sigbits) { BigInteger midpoint; boolean remainder; if (left.compareTo(right) < 0) { BigInteger sum = left.add(right); remainder = sum.testBit(0); midpoint = sum....
[ "public", "static", "Pair", "<", "BigInteger", ",", "Boolean", ">", "midpoint", "(", "BigInteger", "left", ",", "BigInteger", "right", ",", "int", "sigbits", ")", "{", "BigInteger", "midpoint", ";", "boolean", "remainder", ";", "if", "(", "left", ".", "com...
Given two bit arrays represented as BigIntegers, containing the given number of significant bits, calculate a midpoint. @param left The left point. @param right The right point. @param sigbits The number of bits in the points that are significant. @return A midpoint that will compare bitwise halfway between the params...
[ "Given", "two", "bit", "arrays", "represented", "as", "BigIntegers", "containing", "the", "given", "number", "of", "significant", "bits", "calculate", "a", "midpoint", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/FBUtilities.java#L183-L202
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/FBUtilities.java
FBUtilities.construct
public static <T> T construct(String classname, String readable) throws ConfigurationException { Class<T> cls = FBUtilities.classForName(classname, readable); try { return cls.newInstance(); } catch (IllegalAccessException e) { throw new Config...
java
public static <T> T construct(String classname, String readable) throws ConfigurationException { Class<T> cls = FBUtilities.classForName(classname, readable); try { return cls.newInstance(); } catch (IllegalAccessException e) { throw new Config...
[ "public", "static", "<", "T", ">", "T", "construct", "(", "String", "classname", ",", "String", "readable", ")", "throws", "ConfigurationException", "{", "Class", "<", "T", ">", "cls", "=", "FBUtilities", ".", "classForName", "(", "classname", ",", "readable...
Constructs an instance of the given class, which must have a no-arg or default constructor. @param classname Fully qualified classname. @param readable Descriptive noun for the role the class plays. @throws ConfigurationException If the class cannot be found.
[ "Constructs", "an", "instance", "of", "the", "given", "class", "which", "must", "have", "a", "no", "-", "arg", "or", "default", "constructor", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/FBUtilities.java#L472-L494
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/utils/FBUtilities.java
FBUtilities.exec
public static void exec(ProcessBuilder pb) throws IOException { Process p = pb.start(); try { int errCode = p.waitFor(); if (errCode != 0) { BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); ...
java
public static void exec(ProcessBuilder pb) throws IOException { Process p = pb.start(); try { int errCode = p.waitFor(); if (errCode != 0) { BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); ...
[ "public", "static", "void", "exec", "(", "ProcessBuilder", "pb", ")", "throws", "IOException", "{", "Process", "p", "=", "pb", ".", "start", "(", ")", ";", "try", "{", "int", "errCode", "=", "p", ".", "waitFor", "(", ")", ";", "if", "(", "errCode", ...
Starts and waits for the given @param pb to finish. @throws java.io.IOException on non-zero exit code
[ "Starts", "and", "waits", "for", "the", "given" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/FBUtilities.java#L577-L602
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.removeUnreadableSSTables
public static void removeUnreadableSSTables(File directory) { for (Keyspace keyspace : Keyspace.all()) { for (ColumnFamilyStore baseCfs : keyspace.getColumnFamilyStores()) { for (ColumnFamilyStore cfs : baseCfs.concatWithIndexes()) cfs.mayb...
java
public static void removeUnreadableSSTables(File directory) { for (Keyspace keyspace : Keyspace.all()) { for (ColumnFamilyStore baseCfs : keyspace.getColumnFamilyStores()) { for (ColumnFamilyStore cfs : baseCfs.concatWithIndexes()) cfs.mayb...
[ "public", "static", "void", "removeUnreadableSSTables", "(", "File", "directory", ")", "{", "for", "(", "Keyspace", "keyspace", ":", "Keyspace", ".", "all", "(", ")", ")", "{", "for", "(", "ColumnFamilyStore", "baseCfs", ":", "keyspace", ".", "getColumnFamilyS...
Removes every SSTable in the directory from the appropriate DataTracker's view. @param directory the unreadable directory, possibly with SSTables in it, but not necessarily.
[ "Removes", "every", "SSTable", "in", "the", "directory", "from", "the", "appropriate", "DataTracker", "s", "view", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L155-L165
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.snapshot
public void snapshot(String snapshotName, String columnFamilyName) throws IOException { assert snapshotName != null; boolean tookSnapShot = false; for (ColumnFamilyStore cfStore : columnFamilyStores.values()) { if (columnFamilyName == null || cfStore.name.equals(columnFam...
java
public void snapshot(String snapshotName, String columnFamilyName) throws IOException { assert snapshotName != null; boolean tookSnapShot = false; for (ColumnFamilyStore cfStore : columnFamilyStores.values()) { if (columnFamilyName == null || cfStore.name.equals(columnFam...
[ "public", "void", "snapshot", "(", "String", "snapshotName", ",", "String", "columnFamilyName", ")", "throws", "IOException", "{", "assert", "snapshotName", "!=", "null", ";", "boolean", "tookSnapShot", "=", "false", ";", "for", "(", "ColumnFamilyStore", "cfStore"...
Take a snapshot of the specific column family, or the entire set of column families if columnFamily is null with a given timestamp @param snapshotName the tag associated with the name of the snapshot. This value may not be null @param columnFamilyName the column family to snapshot or all on null @throws IOExcepti...
[ "Take", "a", "snapshot", "of", "the", "specific", "column", "family", "or", "the", "entire", "set", "of", "column", "families", "if", "columnFamily", "is", "null", "with", "a", "given", "timestamp" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L196-L211
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.snapshotExists
public boolean snapshotExists(String snapshotName) { assert snapshotName != null; for (ColumnFamilyStore cfStore : columnFamilyStores.values()) { if (cfStore.snapshotExists(snapshotName)) return true; } return false; }
java
public boolean snapshotExists(String snapshotName) { assert snapshotName != null; for (ColumnFamilyStore cfStore : columnFamilyStores.values()) { if (cfStore.snapshotExists(snapshotName)) return true; } return false; }
[ "public", "boolean", "snapshotExists", "(", "String", "snapshotName", ")", "{", "assert", "snapshotName", "!=", "null", ";", "for", "(", "ColumnFamilyStore", "cfStore", ":", "columnFamilyStores", ".", "values", "(", ")", ")", "{", "if", "(", "cfStore", ".", ...
Check whether snapshots already exists for a given name. @param snapshotName the user supplied snapshot name @return true if the snapshot exists
[ "Check", "whether", "snapshots", "already", "exists", "for", "a", "given", "name", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L233-L242
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.clearSnapshot
public static void clearSnapshot(String snapshotName, String keyspace) { List<File> snapshotDirs = Directories.getKSChildDirectories(keyspace); Directories.clearSnapshot(snapshotName, snapshotDirs); }
java
public static void clearSnapshot(String snapshotName, String keyspace) { List<File> snapshotDirs = Directories.getKSChildDirectories(keyspace); Directories.clearSnapshot(snapshotName, snapshotDirs); }
[ "public", "static", "void", "clearSnapshot", "(", "String", "snapshotName", ",", "String", "keyspace", ")", "{", "List", "<", "File", ">", "snapshotDirs", "=", "Directories", ".", "getKSChildDirectories", "(", "keyspace", ")", ";", "Directories", ".", "clearSnap...
Clear all the snapshots for a given keyspace. @param snapshotName the user supplied snapshot name. It empty or null, all the snapshots will be cleaned
[ "Clear", "all", "the", "snapshots", "for", "a", "given", "keyspace", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L250-L254
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.dropCf
public void dropCf(UUID cfId) { assert columnFamilyStores.containsKey(cfId); ColumnFamilyStore cfs = columnFamilyStores.remove(cfId); if (cfs == null) return; // wait for any outstanding reads/writes that might affect the CFS cfs.keyspace.writeOrder.awaitNewBarri...
java
public void dropCf(UUID cfId) { assert columnFamilyStores.containsKey(cfId); ColumnFamilyStore cfs = columnFamilyStores.remove(cfId); if (cfs == null) return; // wait for any outstanding reads/writes that might affect the CFS cfs.keyspace.writeOrder.awaitNewBarri...
[ "public", "void", "dropCf", "(", "UUID", "cfId", ")", "{", "assert", "columnFamilyStores", ".", "containsKey", "(", "cfId", ")", ";", "ColumnFamilyStore", "cfs", "=", "columnFamilyStores", ".", "remove", "(", "cfId", ")", ";", "if", "(", "cfs", "==", "null...
best invoked on the compaction mananger.
[ "best", "invoked", "on", "the", "compaction", "mananger", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L291-L303
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.initCf
public void initCf(UUID cfId, String cfName, boolean loadSSTables) { ColumnFamilyStore cfs = columnFamilyStores.get(cfId); if (cfs == null) { // CFS being created for the first time, either on server startup or new CF being added. // We don't worry about races here; ...
java
public void initCf(UUID cfId, String cfName, boolean loadSSTables) { ColumnFamilyStore cfs = columnFamilyStores.get(cfId); if (cfs == null) { // CFS being created for the first time, either on server startup or new CF being added. // We don't worry about races here; ...
[ "public", "void", "initCf", "(", "UUID", "cfId", ",", "String", "cfName", ",", "boolean", "loadSSTables", ")", "{", "ColumnFamilyStore", "cfs", "=", "columnFamilyStores", ".", "get", "(", "cfId", ")", ";", "if", "(", "cfs", "==", "null", ")", "{", "// CF...
adds a cf to internal structures, ends up creating disk files).
[ "adds", "a", "cf", "to", "internal", "structures", "ends", "up", "creating", "disk", "files", ")", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L315-L337
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/Keyspace.java
Keyspace.apply
public void apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes) { try (OpOrder.Group opGroup = writeOrder.start()) { // write the mutation to the commitlog and memtables ReplayPosition replayPosition = null; if (writeCommitLog) { ...
java
public void apply(Mutation mutation, boolean writeCommitLog, boolean updateIndexes) { try (OpOrder.Group opGroup = writeOrder.start()) { // write the mutation to the commitlog and memtables ReplayPosition replayPosition = null; if (writeCommitLog) { ...
[ "public", "void", "apply", "(", "Mutation", "mutation", ",", "boolean", "writeCommitLog", ",", "boolean", "updateIndexes", ")", "{", "try", "(", "OpOrder", ".", "Group", "opGroup", "=", "writeOrder", ".", "start", "(", ")", ")", "{", "// write the mutation to ...
This method appends a row to the global CommitLog, then updates memtables and indexes. @param mutation the row to write. Must not be modified after calling apply, since commitlog append may happen concurrently, depending on the CL Executor type. @param writeCommitLog false to disable commitlog append entirely @...
[ "This", "method", "appends", "a", "row", "to", "the", "global", "CommitLog", "then", "updates", "memtables", "and", "indexes", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/Keyspace.java#L359-L388
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cql3/functions/AbstractFunction.java
AbstractFunction.factory
public static Function.Factory factory(final Function fun) { return new Function.Factory() { public Function create(String ksName, String cfName) { return fun; } }; }
java
public static Function.Factory factory(final Function fun) { return new Function.Factory() { public Function create(String ksName, String cfName) { return fun; } }; }
[ "public", "static", "Function", ".", "Factory", "factory", "(", "final", "Function", "fun", ")", "{", "return", "new", "Function", ".", "Factory", "(", ")", "{", "public", "Function", "create", "(", "String", "ksName", ",", "String", "cfName", ")", "{", ...
Creates a trivial factory that always return the provided function.
[ "Creates", "a", "trivial", "factory", "that", "always", "return", "the", "provided", "function", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/functions/AbstractFunction.java#L62-L71
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/thrift/TCustomSocket.java
TCustomSocket.initSocket
private void initSocket() { socket = new Socket(); try { socket.setSoLinger(false, 0); socket.setTcpNoDelay(true); socket.setSoTimeout(timeout); } catch (SocketException sx) { LOGGER.error("Could not configure socket.", sx); } }
java
private void initSocket() { socket = new Socket(); try { socket.setSoLinger(false, 0); socket.setTcpNoDelay(true); socket.setSoTimeout(timeout); } catch (SocketException sx) { LOGGER.error("Could not configure socket.", sx); } }
[ "private", "void", "initSocket", "(", ")", "{", "socket", "=", "new", "Socket", "(", ")", ";", "try", "{", "socket", ".", "setSoLinger", "(", "false", ",", "0", ")", ";", "socket", ".", "setTcpNoDelay", "(", "true", ")", ";", "socket", ".", "setSoTim...
Initializes the socket object
[ "Initializes", "the", "socket", "object" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/TCustomSocket.java#L118-L127
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/thrift/TCustomSocket.java
TCustomSocket.setTimeout
public void setTimeout(int timeout) { this.timeout = timeout; try { socket.setSoTimeout(timeout); } catch (SocketException sx) { LOGGER.warn("Could not set socket timeout.", sx); } }
java
public void setTimeout(int timeout) { this.timeout = timeout; try { socket.setSoTimeout(timeout); } catch (SocketException sx) { LOGGER.warn("Could not set socket timeout.", sx); } }
[ "public", "void", "setTimeout", "(", "int", "timeout", ")", "{", "this", ".", "timeout", "=", "timeout", ";", "try", "{", "socket", ".", "setSoTimeout", "(", "timeout", ")", ";", "}", "catch", "(", "SocketException", "sx", ")", "{", "LOGGER", ".", "war...
Sets the socket timeout @param timeout Milliseconds timeout
[ "Sets", "the", "socket", "timeout" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/TCustomSocket.java#L134-L141
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/thrift/TCustomSocket.java
TCustomSocket.open
public void open() throws TTransportException { if (isOpen()) { throw new TTransportException(TTransportException.ALREADY_OPEN, "Socket already connected."); } if (host.length() == 0) { throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open null host."); } if (port <= ...
java
public void open() throws TTransportException { if (isOpen()) { throw new TTransportException(TTransportException.ALREADY_OPEN, "Socket already connected."); } if (host.length() == 0) { throw new TTransportException(TTransportException.NOT_OPEN, "Cannot open null host."); } if (port <= ...
[ "public", "void", "open", "(", ")", "throws", "TTransportException", "{", "if", "(", "isOpen", "(", ")", ")", "{", "throw", "new", "TTransportException", "(", "TTransportException", ".", "ALREADY_OPEN", ",", "\"Socket already connected.\"", ")", ";", "}", "if", ...
Connects the socket, creating a new socket object if necessary.
[ "Connects", "the", "socket", "creating", "a", "new", "socket", "object", "if", "necessary", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/TCustomSocket.java#L166-L190
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/marshal/AbstractCompositeType.java
AbstractCompositeType.split
public ByteBuffer[] split(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<ByteBuffer>(); ByteBuffer bb = name.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { getComparator(i++, bb); l.add(ByteBufferUtil.readBytesWit...
java
public ByteBuffer[] split(ByteBuffer name) { List<ByteBuffer> l = new ArrayList<ByteBuffer>(); ByteBuffer bb = name.duplicate(); readIsStatic(bb); int i = 0; while (bb.remaining() > 0) { getComparator(i++, bb); l.add(ByteBufferUtil.readBytesWit...
[ "public", "ByteBuffer", "[", "]", "split", "(", "ByteBuffer", "name", ")", "{", "List", "<", "ByteBuffer", ">", "l", "=", "new", "ArrayList", "<", "ByteBuffer", ">", "(", ")", ";", "ByteBuffer", "bb", "=", "name", ".", "duplicate", "(", ")", ";", "re...
Split a composite column names into it's components.
[ "Split", "a", "composite", "column", "names", "into", "it", "s", "components", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/AbstractCompositeType.java#L90-L103
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/cache/ConcurrentLinkedHashCache.java
ConcurrentLinkedHashCache.create
public static <K extends IMeasurableMemory, V extends IMeasurableMemory> ConcurrentLinkedHashCache<K, V> create(long weightedCapacity, EntryWeigher<K, V> entryWeiger) { ConcurrentLinkedHashMap<K, V> map = new ConcurrentLinkedHashMap.Builder<K, V>() .weigher(entryW...
java
public static <K extends IMeasurableMemory, V extends IMeasurableMemory> ConcurrentLinkedHashCache<K, V> create(long weightedCapacity, EntryWeigher<K, V> entryWeiger) { ConcurrentLinkedHashMap<K, V> map = new ConcurrentLinkedHashMap.Builder<K, V>() .weigher(entryW...
[ "public", "static", "<", "K", "extends", "IMeasurableMemory", ",", "V", "extends", "IMeasurableMemory", ">", "ConcurrentLinkedHashCache", "<", "K", ",", "V", ">", "create", "(", "long", "weightedCapacity", ",", "EntryWeigher", "<", "K", ",", "V", ">", "entryWe...
Initialize a cache with initial capacity with weightedCapacity
[ "Initialize", "a", "cache", "with", "initial", "capacity", "with", "weightedCapacity" ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cache/ConcurrentLinkedHashCache.java#L40-L49
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/repair/StreamingRepairTask.java
StreamingRepairTask.onSuccess
public void onSuccess(StreamState state) { logger.info(String.format("[repair #%s] streaming task succeed, returning response to %s", desc.sessionId, request.initiator)); MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, true).createMessage(), request.initiator)...
java
public void onSuccess(StreamState state) { logger.info(String.format("[repair #%s] streaming task succeed, returning response to %s", desc.sessionId, request.initiator)); MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, true).createMessage(), request.initiator)...
[ "public", "void", "onSuccess", "(", "StreamState", "state", ")", "{", "logger", ".", "info", "(", "String", ".", "format", "(", "\"[repair #%s] streaming task succeed, returning response to %s\"", ",", "desc", ".", "sessionId", ",", "request", ".", "initiator", ")",...
If we succeeded on both stream in and out, reply back to the initiator.
[ "If", "we", "succeeded", "on", "both", "stream", "in", "and", "out", "reply", "back", "to", "the", "initiator", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/StreamingRepairTask.java#L94-L98
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/repair/StreamingRepairTask.java
StreamingRepairTask.onFailure
public void onFailure(Throwable t) { MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, false).createMessage(), request.initiator); }
java
public void onFailure(Throwable t) { MessagingService.instance().sendOneWay(new SyncComplete(desc, request.src, request.dst, false).createMessage(), request.initiator); }
[ "public", "void", "onFailure", "(", "Throwable", "t", ")", "{", "MessagingService", ".", "instance", "(", ")", ".", "sendOneWay", "(", "new", "SyncComplete", "(", "desc", ",", "request", ".", "src", ",", "request", ".", "dst", ",", "false", ")", ".", "...
If we failed on either stream in or out, reply fail to the initiator.
[ "If", "we", "failed", "on", "either", "stream", "in", "or", "out", "reply", "fail", "to", "the", "initiator", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/StreamingRepairTask.java#L103-L106
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/context/CounterContext.java
CounterContext.createLocal
public ByteBuffer createLocal(long count) { ContextState state = ContextState.allocate(0, 1, 0); state.writeLocal(CounterId.getLocalId(), 1L, count); return state.context; }
java
public ByteBuffer createLocal(long count) { ContextState state = ContextState.allocate(0, 1, 0); state.writeLocal(CounterId.getLocalId(), 1L, count); return state.context; }
[ "public", "ByteBuffer", "createLocal", "(", "long", "count", ")", "{", "ContextState", "state", "=", "ContextState", ".", "allocate", "(", "0", ",", "1", ",", "0", ")", ";", "state", ".", "writeLocal", "(", "CounterId", ".", "getLocalId", "(", ")", ",", ...
Creates a counter context with a single local shard. For use by tests of compatibility with pre-2.1 counters only.
[ "Creates", "a", "counter", "context", "with", "a", "single", "local", "shard", ".", "For", "use", "by", "tests", "of", "compatibility", "with", "pre", "-", "2", ".", "1", "counters", "only", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/context/CounterContext.java#L116-L121
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/context/CounterContext.java
CounterContext.createRemote
public ByteBuffer createRemote(CounterId id, long clock, long count) { ContextState state = ContextState.allocate(0, 0, 1); state.writeRemote(id, clock, count); return state.context; }
java
public ByteBuffer createRemote(CounterId id, long clock, long count) { ContextState state = ContextState.allocate(0, 0, 1); state.writeRemote(id, clock, count); return state.context; }
[ "public", "ByteBuffer", "createRemote", "(", "CounterId", "id", ",", "long", "clock", ",", "long", "count", ")", "{", "ContextState", "state", "=", "ContextState", ".", "allocate", "(", "0", ",", "0", ",", "1", ")", ";", "state", ".", "writeRemote", "(",...
Creates a counter context with a single remote shard. For use by tests of compatibility with pre-2.1 counters only.
[ "Creates", "a", "counter", "context", "with", "a", "single", "remote", "shard", ".", "For", "use", "by", "tests", "of", "compatibility", "with", "pre", "-", "2", ".", "1", "counters", "only", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/context/CounterContext.java#L127-L132
train
Stratio/stratio-cassandra
src/java/org/apache/cassandra/db/context/CounterContext.java
CounterContext.diff
public Relationship diff(ByteBuffer left, ByteBuffer right) { Relationship relationship = Relationship.EQUAL; ContextState leftState = ContextState.wrap(left); ContextState rightState = ContextState.wrap(right); while (leftState.hasRemaining() && rightState.hasRemaining()) {...
java
public Relationship diff(ByteBuffer left, ByteBuffer right) { Relationship relationship = Relationship.EQUAL; ContextState leftState = ContextState.wrap(left); ContextState rightState = ContextState.wrap(right); while (leftState.hasRemaining() && rightState.hasRemaining()) {...
[ "public", "Relationship", "diff", "(", "ByteBuffer", "left", ",", "ByteBuffer", "right", ")", "{", "Relationship", "relationship", "=", "Relationship", ".", "EQUAL", ";", "ContextState", "leftState", "=", "ContextState", ".", "wrap", "(", "left", ")", ";", "Co...
Determine the count relationship between two contexts. EQUAL: Equal set of nodes and every count is equal. GREATER_THAN: Superset of nodes and every count is equal or greater than its corollary. LESS_THAN: Subset of nodes and every count is equal or less than its corollary. DISJOINT: Node sets are not eq...
[ "Determine", "the", "count", "relationship", "between", "two", "contexts", "." ]
f6416b43ad5309083349ad56266450fa8c6a2106
https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/context/CounterContext.java#L158-L249
train