id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
36,100 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java | ColumnFamilyRecordReader.getLocation | private String getLocation()
{
Collection<InetAddress> localAddresses = FBUtilities.getAllLocalAddresses();
for (InetAddress address : localAddresses)
{
for (String location : split.getLocations())
{
InetAddress locationAddress = null;
... | java | private String getLocation()
{
Collection<InetAddress> localAddresses = FBUtilities.getAllLocalAddresses();
for (InetAddress address : localAddresses)
{
for (String location : split.getLocations())
{
InetAddress locationAddress = null;
... | [
"private",
"String",
"getLocation",
"(",
")",
"{",
"Collection",
"<",
"InetAddress",
">",
"localAddresses",
"=",
"FBUtilities",
".",
"getAllLocalAddresses",
"(",
")",
";",
"for",
"(",
"InetAddress",
"address",
":",
"localAddresses",
")",
"{",
"for",
"(",
"Stri... | not necessarily on Cassandra machines, too. This should be adequate for single-DC clusters, at least. | [
"not",
"necessarily",
"on",
"Cassandra",
"machines",
"too",
".",
"This",
"should",
"be",
"adequate",
"for",
"single",
"-",
"DC",
"clusters",
"at",
"least",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/ColumnFamilyRecordReader.java#L189-L213 |
36,101 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/thrift/ThriftConversion.java | ThriftConversion.rethrow | public static RuntimeException rethrow(RequestExecutionException e) throws UnavailableException, TimedOutException
{
if (e instanceof RequestTimeoutException)
throw toThrift((RequestTimeoutException)e);
else
throw new UnavailableException();
} | java | public static RuntimeException rethrow(RequestExecutionException e) throws UnavailableException, TimedOutException
{
if (e instanceof RequestTimeoutException)
throw toThrift((RequestTimeoutException)e);
else
throw new UnavailableException();
} | [
"public",
"static",
"RuntimeException",
"rethrow",
"(",
"RequestExecutionException",
"e",
")",
"throws",
"UnavailableException",
",",
"TimedOutException",
"{",
"if",
"(",
"e",
"instanceof",
"RequestTimeoutException",
")",
"throw",
"toThrift",
"(",
"(",
"RequestTimeoutEx... | for methods that have a return value. | [
"for",
"methods",
"that",
"have",
"a",
"return",
"value",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/thrift/ThriftConversion.java#L76-L82 |
36,102 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java | OutboundTcpConnectionPool.getConnection | OutboundTcpConnection getConnection(MessageOut msg)
{
Stage stage = msg.getStage();
return stage == Stage.REQUEST_RESPONSE || stage == Stage.INTERNAL_RESPONSE || stage == Stage.GOSSIP
? ackCon
: cmdCon;
} | java | OutboundTcpConnection getConnection(MessageOut msg)
{
Stage stage = msg.getStage();
return stage == Stage.REQUEST_RESPONSE || stage == Stage.INTERNAL_RESPONSE || stage == Stage.GOSSIP
? ackCon
: cmdCon;
} | [
"OutboundTcpConnection",
"getConnection",
"(",
"MessageOut",
"msg",
")",
"{",
"Stage",
"stage",
"=",
"msg",
".",
"getStage",
"(",
")",
";",
"return",
"stage",
"==",
"Stage",
".",
"REQUEST_RESPONSE",
"||",
"stage",
"==",
"Stage",
".",
"INTERNAL_RESPONSE",
"||",... | returns the appropriate connection based on message type.
returns null if a connection could not be established. | [
"returns",
"the",
"appropriate",
"connection",
"based",
"on",
"message",
"type",
".",
"returns",
"null",
"if",
"a",
"connection",
"could",
"not",
"be",
"established",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java#L62-L68 |
36,103 | Stratio/stratio-cassandra | src/java/com/stratio/cassandra/contrib/NotifyingBlockingThreadPoolExecutor.java | NotifyingBlockingThreadPoolExecutor.execute | @Override
public void execute(Runnable task) {
// count a new task in process
tasksInProcess.incrementAndGet();
try {
super.execute(task);
} catch (RuntimeException e) { // specifically handle RejectedExecutionException
tasksInProcess.decrementAndGet();
... | java | @Override
public void execute(Runnable task) {
// count a new task in process
tasksInProcess.incrementAndGet();
try {
super.execute(task);
} catch (RuntimeException e) { // specifically handle RejectedExecutionException
tasksInProcess.decrementAndGet();
... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
"Runnable",
"task",
")",
"{",
"// count a new task in process",
"tasksInProcess",
".",
"incrementAndGet",
"(",
")",
";",
"try",
"{",
"super",
".",
"execute",
"(",
"task",
")",
";",
"}",
"catch",
"(",
"Runtim... | Before calling super's version of this method, the amount of tasks which are currently in process is first
incremented.
@see java.util.concurrent.ThreadPoolExecutor#execute(Runnable) | [
"Before",
"calling",
"super",
"s",
"version",
"of",
"this",
"method",
"the",
"amount",
"of",
"tasks",
"which",
"are",
"currently",
"in",
"process",
"is",
"first",
"incremented",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/contrib/NotifyingBlockingThreadPoolExecutor.java#L123-L136 |
36,104 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/Downsampling.java | Downsampling.getEffectiveIndexIntervalAfterIndex | public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval)
{
assert index >= 0;
index %= samplingLevel;
List<Integer> originalIndexes = getOriginalIndexes(samplingLevel);
int nextEntryOriginalIndex = (index == originalIndexes.size() - 1)... | java | public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval)
{
assert index >= 0;
index %= samplingLevel;
List<Integer> originalIndexes = getOriginalIndexes(samplingLevel);
int nextEntryOriginalIndex = (index == originalIndexes.size() - 1)... | [
"public",
"static",
"int",
"getEffectiveIndexIntervalAfterIndex",
"(",
"int",
"index",
",",
"int",
"samplingLevel",
",",
"int",
"minIndexInterval",
")",
"{",
"assert",
"index",
">=",
"0",
";",
"index",
"%=",
"samplingLevel",
";",
"List",
"<",
"Integer",
">",
"... | Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this
returns the number of partitions in the primary on-disk index before the next partition that has an entry in
the index summary. If samplingLevel == BASE_SAMPLING_LEVEL, this will be equal to the index interval.... | [
"Calculates",
"the",
"effective",
"index",
"interval",
"after",
"the",
"entry",
"at",
"index",
"in",
"an",
"IndexSummary",
".",
"In",
"other",
"words",
"this",
"returns",
"the",
"number",
"of",
"partitions",
"in",
"the",
"primary",
"on",
"-",
"disk",
"index"... | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/Downsampling.java#L116-L123 |
36,105 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | CommitLogSegment.allocate | Allocation allocate(Mutation mutation, int size)
{
final OpOrder.Group opGroup = appendOrder.start();
try
{
int position = allocate(size);
if (position < 0)
{
opGroup.close();
return null;
}
markDirty... | java | Allocation allocate(Mutation mutation, int size)
{
final OpOrder.Group opGroup = appendOrder.start();
try
{
int position = allocate(size);
if (position < 0)
{
opGroup.close();
return null;
}
markDirty... | [
"Allocation",
"allocate",
"(",
"Mutation",
"mutation",
",",
"int",
"size",
")",
"{",
"final",
"OpOrder",
".",
"Group",
"opGroup",
"=",
"appendOrder",
".",
"start",
"(",
")",
";",
"try",
"{",
"int",
"position",
"=",
"allocate",
"(",
"size",
")",
";",
"i... | Allocate space in this buffer for the provided mutation, and return the allocated Allocation object.
Returns null if there is not enough space in this segment, and a new segment is needed. | [
"Allocate",
"space",
"in",
"this",
"buffer",
"for",
"the",
"provided",
"mutation",
"and",
"return",
"the",
"allocated",
"Allocation",
"object",
".",
"Returns",
"null",
"if",
"there",
"is",
"not",
"enough",
"space",
"in",
"this",
"segment",
"and",
"a",
"new",... | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L185-L204 |
36,106 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | CommitLogSegment.allocate | private int allocate(int size)
{
while (true)
{
int prev = allocatePosition.get();
int next = prev + size;
if (next >= buffer.capacity())
return -1;
if (allocatePosition.compareAndSet(prev, next))
return prev;
}
... | java | private int allocate(int size)
{
while (true)
{
int prev = allocatePosition.get();
int next = prev + size;
if (next >= buffer.capacity())
return -1;
if (allocatePosition.compareAndSet(prev, next))
return prev;
}
... | [
"private",
"int",
"allocate",
"(",
"int",
"size",
")",
"{",
"while",
"(",
"true",
")",
"{",
"int",
"prev",
"=",
"allocatePosition",
".",
"get",
"(",
")",
";",
"int",
"next",
"=",
"prev",
"+",
"size",
";",
"if",
"(",
"next",
">=",
"buffer",
".",
"... | allocate bytes in the segment, or return -1 if not enough space | [
"allocate",
"bytes",
"in",
"the",
"segment",
"or",
"return",
"-",
"1",
"if",
"not",
"enough",
"space"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L207-L218 |
36,107 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | CommitLogSegment.discardUnusedTail | void discardUnusedTail()
{
// we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom()
// this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block
// already protected by this OpOrde... | java | void discardUnusedTail()
{
// we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom()
// this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block
// already protected by this OpOrde... | [
"void",
"discardUnusedTail",
"(",
")",
"{",
"// we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom()",
"// this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block",
"// already protected ... | ensures no more of this segment is writeable, by allocating any unused section at the end and marking it discarded | [
"ensures",
"no",
"more",
"of",
"this",
"segment",
"is",
"writeable",
"by",
"allocating",
"any",
"unused",
"section",
"at",
"the",
"end",
"and",
"marking",
"it",
"discarded"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L221-L243 |
36,108 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | CommitLogSegment.sync | synchronized void sync()
{
try
{
// check we have more work to do
if (allocatePosition.get() <= lastSyncedOffset + SYNC_MARKER_SIZE)
return;
// allocate a new sync marker; this is both necessary in itself, but also serves to demarcate
... | java | synchronized void sync()
{
try
{
// check we have more work to do
if (allocatePosition.get() <= lastSyncedOffset + SYNC_MARKER_SIZE)
return;
// allocate a new sync marker; this is both necessary in itself, but also serves to demarcate
... | [
"synchronized",
"void",
"sync",
"(",
")",
"{",
"try",
"{",
"// check we have more work to do",
"if",
"(",
"allocatePosition",
".",
"get",
"(",
")",
"<=",
"lastSyncedOffset",
"+",
"SYNC_MARKER_SIZE",
")",
"return",
";",
"// allocate a new sync marker; this is both necess... | Forces a disk flush for this segment file. | [
"Forces",
"a",
"disk",
"flush",
"for",
"this",
"segment",
"file",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L257-L331 |
36,109 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | CommitLogSegment.recycle | CommitLogSegment recycle()
{
try
{
sync();
}
catch (FSWriteError e)
{
logger.error("I/O error flushing {} {}", this, e.getMessage());
throw e;
}
close();
return new CommitLogSegment(getPath());
} | java | CommitLogSegment recycle()
{
try
{
sync();
}
catch (FSWriteError e)
{
logger.error("I/O error flushing {} {}", this, e.getMessage());
throw e;
}
close();
return new CommitLogSegment(getPath());
} | [
"CommitLogSegment",
"recycle",
"(",
")",
"{",
"try",
"{",
"sync",
"(",
")",
";",
"}",
"catch",
"(",
"FSWriteError",
"e",
")",
"{",
"logger",
".",
"error",
"(",
"\"I/O error flushing {} {}\"",
",",
"this",
",",
"e",
".",
"getMessage",
"(",
")",
")",
";"... | Recycle processes an unneeded segment file for reuse.
@return a new CommitLogSegment representing the newly reusable segment. | [
"Recycle",
"processes",
"an",
"unneeded",
"segment",
"file",
"for",
"reuse",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L351-L366 |
36,110 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | CommitLogSegment.markClean | public synchronized void markClean(UUID cfId, ReplayPosition context)
{
if (!cfDirty.containsKey(cfId))
return;
if (context.segment == id)
markClean(cfId, context.position);
else if (context.segment > id)
markClean(cfId, Integer.MAX_VALUE);
} | java | public synchronized void markClean(UUID cfId, ReplayPosition context)
{
if (!cfDirty.containsKey(cfId))
return;
if (context.segment == id)
markClean(cfId, context.position);
else if (context.segment > id)
markClean(cfId, Integer.MAX_VALUE);
} | [
"public",
"synchronized",
"void",
"markClean",
"(",
"UUID",
"cfId",
",",
"ReplayPosition",
"context",
")",
"{",
"if",
"(",
"!",
"cfDirty",
".",
"containsKey",
"(",
"cfId",
")",
")",
"return",
";",
"if",
"(",
"context",
".",
"segment",
"==",
"id",
")",
... | Marks the ColumnFamily specified by cfId as clean for this log segment. If the
given context argument is contained in this file, it will only mark the CF as
clean if no newer writes have taken place.
@param cfId the column family ID that is now clean
@param context the optional clean offset | [
"Marks",
"the",
"ColumnFamily",
"specified",
"by",
"cfId",
"as",
"clean",
"for",
"this",
"log",
"segment",
".",
"If",
"the",
"given",
"context",
"argument",
"is",
"contained",
"in",
"this",
"file",
"it",
"will",
"only",
"mark",
"the",
"CF",
"as",
"clean",
... | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L455-L463 |
36,111 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java | CommitLogSegment.dirtyString | public String dirtyString()
{
StringBuilder sb = new StringBuilder();
for (UUID cfId : getDirtyCFIDs())
{
CFMetaData m = Schema.instance.getCFMetaData(cfId);
sb.append(m == null ? "<deleted>" : m.cfName).append(" (").append(cfId).append("), ");
}
retur... | java | public String dirtyString()
{
StringBuilder sb = new StringBuilder();
for (UUID cfId : getDirtyCFIDs())
{
CFMetaData m = Schema.instance.getCFMetaData(cfId);
sb.append(m == null ? "<deleted>" : m.cfName).append(" (").append(cfId).append("), ");
}
retur... | [
"public",
"String",
"dirtyString",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"UUID",
"cfId",
":",
"getDirtyCFIDs",
"(",
")",
")",
"{",
"CFMetaData",
"m",
"=",
"Schema",
".",
"instance",
".",
"getCFMetaD... | For debugging, not fast | [
"For",
"debugging",
"not",
"fast"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/commitlog/CommitLogSegment.java#L557-L566 |
36,112 | Stratio/stratio-cassandra | src/java/org/apache/cassandra/streaming/StreamPlan.java | StreamPlan.transferFiles | public StreamPlan transferFiles(InetAddress to, Collection<StreamSession.SSTableStreamingSections> sstableDetails)
{
coordinator.transferFiles(to, sstableDetails);
return this;
} | java | public StreamPlan transferFiles(InetAddress to, Collection<StreamSession.SSTableStreamingSections> sstableDetails)
{
coordinator.transferFiles(to, sstableDetails);
return this;
} | [
"public",
"StreamPlan",
"transferFiles",
"(",
"InetAddress",
"to",
",",
"Collection",
"<",
"StreamSession",
".",
"SSTableStreamingSections",
">",
"sstableDetails",
")",
"{",
"coordinator",
".",
"transferFiles",
"(",
"to",
",",
"sstableDetails",
")",
";",
"return",
... | Add transfer task to send given SSTable files.
@param to endpoint address of receiver
@param sstableDetails sstables with file positions and estimated key count.
this collection will be modified to remove those files that are successfully handed off
@return this object for chaining | [
"Add",
"transfer",
"task",
"to",
"send",
"given",
"SSTable",
"files",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/StreamPlan.java#L142-L147 |
36,113 | 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 |
36,114 | 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 |
36,115 | 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 |
36,116 | 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 |
36,117 | 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 |
36,118 | 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 |
36,119 | 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 |
36,120 | 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 |
36,121 | 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 |
36,122 | 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 |
36,123 | 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 |
36,124 | 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 |
36,125 | 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 |
36,126 | 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 |
36,127 | 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 |
36,128 | 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 |
36,129 | 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 |
36,130 | 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 |
36,131 | 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 |
36,132 | 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 < 0 or index >= 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 |
36,133 | 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 |
36,134 | 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 |
36,135 | 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 |
36,136 | 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 |
36,137 | 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 |
36,138 | 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 |
36,139 | 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 |
36,140 | 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 |
36,141 | 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 |
36,142 | 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 |
36,143 | 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 |
36,144 | 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 |
36,145 | 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 |
36,146 | 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 |
36,147 | 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 |
36,148 | 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 |
36,149 | 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 |
36,150 | 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 |
36,151 | 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 |
36,152 | 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 |
36,153 | 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 |
36,154 | 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 |
36,155 | 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 |
36,156 | 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 |
36,157 | 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 |
36,158 | 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 |
36,159 | 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 |
36,160 | 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 |
36,161 | 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 |
36,162 | 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 |
36,163 | 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 |
36,164 | 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 |
36,165 | 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 |
36,166 | 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 |
36,167 | 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 |
36,168 | 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 |
36,169 | 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 |
36,170 | 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 |
36,171 | 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 |
36,172 | 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 |
36,173 | 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 |
36,174 | 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 |
36,175 | 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 |
36,176 | 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 |
36,177 | 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 |
36,178 | 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 |
36,179 | 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 |
36,180 | 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 |
36,181 | 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 |
36,182 | 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 |
36,183 | 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 |
36,184 | 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 |
36,185 | 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 |
36,186 | 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 |
36,187 | 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 |
36,188 | 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 |
36,189 | 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 |
36,190 | 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 |
36,191 | 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 |
36,192 | 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 |
36,193 | 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 |
36,194 | 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 |
36,195 | 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 |
36,196 | 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 |
36,197 | 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 |
36,198 | 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 |
36,199 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.