repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/IndexHelper.java | IndexHelper.skipIndex | public static void skipIndex(DataInput in) throws IOException
{
/* read only the column index list */
int columnIndexSize = in.readInt();
/* skip the column index data */
if (in instanceof FileDataInput)
{
FileUtils.skipBytesFully(in, columnIndexSize);
}
... | java | public static void skipIndex(DataInput in) throws IOException
{
/* read only the column index list */
int columnIndexSize = in.readInt();
/* skip the column index data */
if (in instanceof FileDataInput)
{
FileUtils.skipBytesFully(in, columnIndexSize);
}
... | [
"public",
"static",
"void",
"skipIndex",
"(",
"DataInput",
"in",
")",
"throws",
"IOException",
"{",
"/* read only the column index list */",
"int",
"columnIndexSize",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"/* skip the column index data */",
"if",
"(",
"in",
"ins... | Skip the index
@param in the data input from which the index should be skipped
@throws IOException if an I/O error occurs. | [
"Skip",
"the",
"index"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/IndexHelper.java#L52-L67 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/IndexHelper.java | IndexHelper.deserializeIndex | public static List<IndexInfo> deserializeIndex(FileDataInput in, CType type) throws IOException
{
int columnIndexSize = in.readInt();
if (columnIndexSize == 0)
return Collections.<IndexInfo>emptyList();
ArrayList<IndexInfo> indexList = new ArrayList<IndexInfo>();
FileMark... | java | public static List<IndexInfo> deserializeIndex(FileDataInput in, CType type) throws IOException
{
int columnIndexSize = in.readInt();
if (columnIndexSize == 0)
return Collections.<IndexInfo>emptyList();
ArrayList<IndexInfo> indexList = new ArrayList<IndexInfo>();
FileMark... | [
"public",
"static",
"List",
"<",
"IndexInfo",
">",
"deserializeIndex",
"(",
"FileDataInput",
"in",
",",
"CType",
"type",
")",
"throws",
"IOException",
"{",
"int",
"columnIndexSize",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"if",
"(",
"columnIndexSize",
"=="... | Deserialize the index into a structure and return it
@param in input source
@param type the comparator type for the column family
@return ArrayList<IndexInfo> - list of de-serialized indexes
@throws IOException if an I/O error occurs. | [
"Deserialize",
"the",
"index",
"into",
"a",
"structure",
"and",
"return",
"it"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/IndexHelper.java#L78-L93 | train |
Stratio/stratio-cassandra | tools/stress/src/org/apache/cassandra/stress/util/Timing.java | Timing.newTimer | public Timer newTimer(String opType, int sampleCount)
{
final Timer timer = new Timer(sampleCount);
if (!timers.containsKey(opType))
timers.put(opType, new ArrayList<Timer>());
timers.get(opType).add(timer);
return timer;
} | java | public Timer newTimer(String opType, int sampleCount)
{
final Timer timer = new Timer(sampleCount);
if (!timers.containsKey(opType))
timers.put(opType, new ArrayList<Timer>());
timers.get(opType).add(timer);
return timer;
} | [
"public",
"Timer",
"newTimer",
"(",
"String",
"opType",
",",
"int",
"sampleCount",
")",
"{",
"final",
"Timer",
"timer",
"=",
"new",
"Timer",
"(",
"sampleCount",
")",
";",
"if",
"(",
"!",
"timers",
".",
"containsKey",
"(",
"opType",
")",
")",
"timers",
... | build a new timer and add it to the set of running timers. | [
"build",
"a",
"new",
"timer",
"and",
"add",
"it",
"to",
"the",
"set",
"of",
"running",
"timers",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/Timing.java#L125-L134 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/AbstractBulkRecordWriter.java | AbstractBulkRecordWriter.close | @Deprecated
public void close(org.apache.hadoop.mapred.Reporter reporter) throws IOException
{
close();
} | java | @Deprecated
public void close(org.apache.hadoop.mapred.Reporter reporter) throws IOException
{
close();
} | [
"@",
"Deprecated",
"public",
"void",
"close",
"(",
"org",
".",
"apache",
".",
"hadoop",
".",
"mapred",
".",
"Reporter",
"reporter",
")",
"throws",
"IOException",
"{",
"close",
"(",
")",
";",
"}"
] | Fills the deprecated RecordWriter interface for streaming. | [
"Fills",
"the",
"deprecated",
"RecordWriter",
"interface",
"for",
"streaming",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/AbstractBulkRecordWriter.java#L111-L115 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java | SelectStatement.forSelection | static SelectStatement forSelection(CFMetaData cfm, Selection selection)
{
return new SelectStatement(cfm, 0, defaultParameters, selection, null);
} | java | static SelectStatement forSelection(CFMetaData cfm, Selection selection)
{
return new SelectStatement(cfm, 0, defaultParameters, selection, null);
} | [
"static",
"SelectStatement",
"forSelection",
"(",
"CFMetaData",
"cfm",
",",
"Selection",
"selection",
")",
"{",
"return",
"new",
"SelectStatement",
"(",
"cfm",
",",
"0",
",",
"defaultParameters",
",",
"selection",
",",
"null",
")",
";",
"}"
] | queried data through processColumnFamily. | [
"queried",
"data",
"through",
"processColumnFamily",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L161-L164 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java | SelectStatement.selectACollection | private boolean selectACollection()
{
if (!cfm.comparator.hasCollections())
return false;
for (ColumnDefinition def : selection.getColumns())
{
if (def.type.isCollection() && def.type.isMultiCell())
return true;
}
return false;
} | java | private boolean selectACollection()
{
if (!cfm.comparator.hasCollections())
return false;
for (ColumnDefinition def : selection.getColumns())
{
if (def.type.isCollection() && def.type.isMultiCell())
return true;
}
return false;
} | [
"private",
"boolean",
"selectACollection",
"(",
")",
"{",
"if",
"(",
"!",
"cfm",
".",
"comparator",
".",
"hasCollections",
"(",
")",
")",
"return",
"false",
";",
"for",
"(",
"ColumnDefinition",
"def",
":",
"selection",
".",
"getColumns",
"(",
")",
")",
"... | Returns true if a non-frozen collection is selected, false otherwise. | [
"Returns",
"true",
"if",
"a",
"non",
"-",
"frozen",
"collection",
"is",
"selected",
"false",
"otherwise",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L836-L848 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java | SelectStatement.addEOC | private static Composite addEOC(Composite composite, Bound eocBound)
{
return eocBound == Bound.END ? composite.end() : composite.start();
} | java | private static Composite addEOC(Composite composite, Bound eocBound)
{
return eocBound == Bound.END ? composite.end() : composite.start();
} | [
"private",
"static",
"Composite",
"addEOC",
"(",
"Composite",
"composite",
",",
"Bound",
"eocBound",
")",
"{",
"return",
"eocBound",
"==",
"Bound",
".",
"END",
"?",
"composite",
".",
"end",
"(",
")",
":",
"composite",
".",
"start",
"(",
")",
";",
"}"
] | Adds an EOC to the specified Composite.
@param composite the composite
@param eocBound the EOC bound
@return a new <code>Composite</code> with the EOC corresponding to the eocBound | [
"Adds",
"an",
"EOC",
"to",
"the",
"specified",
"Composite",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L979-L982 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java | SelectStatement.addValue | private static void addValue(CBuilder builder, ColumnDefinition def, ByteBuffer value) throws InvalidRequestException
{
if (value == null)
throw new InvalidRequestException(String.format("Invalid null value in condition for column %s", def.name));
builder.add(value);
} | java | private static void addValue(CBuilder builder, ColumnDefinition def, ByteBuffer value) throws InvalidRequestException
{
if (value == null)
throw new InvalidRequestException(String.format("Invalid null value in condition for column %s", def.name));
builder.add(value);
} | [
"private",
"static",
"void",
"addValue",
"(",
"CBuilder",
"builder",
",",
"ColumnDefinition",
"def",
",",
"ByteBuffer",
"value",
")",
"throws",
"InvalidRequestException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"InvalidRequestException",
"(",
... | Adds the specified value to the specified builder
@param builder the CBuilder to which the value must be added
@param def the column associated to the value
@param value the value to add
@throws InvalidRequestException if the value is null | [
"Adds",
"the",
"specified",
"value",
"to",
"the",
"specified",
"builder"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L992-L997 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java | SelectStatement.processColumnFamily | void processColumnFamily(ByteBuffer key, ColumnFamily cf, QueryOptions options, long now, Selection.ResultSetBuilder result)
throws InvalidRequestException
{
CFMetaData cfm = cf.metadata();
ByteBuffer[] keyComponents = null;
if (cfm.getKeyValidator() instanceof CompositeType)
{
... | java | void processColumnFamily(ByteBuffer key, ColumnFamily cf, QueryOptions options, long now, Selection.ResultSetBuilder result)
throws InvalidRequestException
{
CFMetaData cfm = cf.metadata();
ByteBuffer[] keyComponents = null;
if (cfm.getKeyValidator() instanceof CompositeType)
{
... | [
"void",
"processColumnFamily",
"(",
"ByteBuffer",
"key",
",",
"ColumnFamily",
"cf",
",",
"QueryOptions",
"options",
",",
"long",
"now",
",",
"Selection",
".",
"ResultSetBuilder",
"result",
")",
"throws",
"InvalidRequestException",
"{",
"CFMetaData",
"cfm",
"=",
"c... | Used by ModificationStatement for CAS operations | [
"Used",
"by",
"ModificationStatement",
"for",
"CAS",
"operations"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L1216-L1289 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/statements/SelectStatement.java | SelectStatement.isRestrictedByMultipleContains | private boolean isRestrictedByMultipleContains(ColumnDefinition columnDef)
{
if (!columnDef.type.isCollection())
return false;
Restriction restriction = metadataRestrictions.get(columnDef.name);
if (!(restriction instanceof Contains))
return false;
Contains... | java | private boolean isRestrictedByMultipleContains(ColumnDefinition columnDef)
{
if (!columnDef.type.isCollection())
return false;
Restriction restriction = metadataRestrictions.get(columnDef.name);
if (!(restriction instanceof Contains))
return false;
Contains... | [
"private",
"boolean",
"isRestrictedByMultipleContains",
"(",
"ColumnDefinition",
"columnDef",
")",
"{",
"if",
"(",
"!",
"columnDef",
".",
"type",
".",
"isCollection",
"(",
")",
")",
"return",
"false",
";",
"Restriction",
"restriction",
"=",
"metadataRestrictions",
... | Checks if the specified column is restricted by multiple contains or contains key.
@param columnDef the definition of the column to check
@return <code>true</code> the specified column is restricted by multiple contains or contains key,
<code>false</code> otherwise | [
"Checks",
"if",
"the",
"specified",
"column",
"is",
"restricted",
"by",
"multiple",
"contains",
"or",
"contains",
"key",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L1399-L1411 | train |
Stratio/stratio-cassandra | tools/stress/src/org/apache/cassandra/stress/util/Timer.java | Timer.requestReport | synchronized void requestReport(CountDownLatch signal)
{
if (finalReport != null)
{
report = finalReport;
finalReport = new TimingInterval(0);
signal.countDown();
}
else
reportRequest = signal;
} | java | synchronized void requestReport(CountDownLatch signal)
{
if (finalReport != null)
{
report = finalReport;
finalReport = new TimingInterval(0);
signal.countDown();
}
else
reportRequest = signal;
} | [
"synchronized",
"void",
"requestReport",
"(",
"CountDownLatch",
"signal",
")",
"{",
"if",
"(",
"finalReport",
"!=",
"null",
")",
"{",
"report",
"=",
"finalReport",
";",
"finalReport",
"=",
"new",
"TimingInterval",
"(",
"0",
")",
";",
"signal",
".",
"countDow... | checks to see if the timer is dead; if not requests a report, and otherwise fulfills the request itself | [
"checks",
"to",
"see",
"if",
"the",
"timer",
"is",
"dead",
";",
"if",
"not",
"requests",
"a",
"report",
"and",
"otherwise",
"fulfills",
"the",
"request",
"itself"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/Timer.java#L142-L152 | train |
Stratio/stratio-cassandra | tools/stress/src/org/apache/cassandra/stress/util/Timer.java | Timer.close | public synchronized void close()
{
if (reportRequest == null)
finalReport = buildReport();
else
{
finalReport = new TimingInterval(0);
report = buildReport();
reportRequest.countDown();
reportRequest = null;
}
} | java | public synchronized void close()
{
if (reportRequest == null)
finalReport = buildReport();
else
{
finalReport = new TimingInterval(0);
report = buildReport();
reportRequest.countDown();
reportRequest = null;
}
} | [
"public",
"synchronized",
"void",
"close",
"(",
")",
"{",
"if",
"(",
"reportRequest",
"==",
"null",
")",
"finalReport",
"=",
"buildReport",
"(",
")",
";",
"else",
"{",
"finalReport",
"=",
"new",
"TimingInterval",
"(",
"0",
")",
";",
"report",
"=",
"build... | closes the timer; if a request is outstanding, it furnishes the request, otherwise it populates finalReport | [
"closes",
"the",
"timer",
";",
"if",
"a",
"request",
"is",
"outstanding",
"it",
"furnishes",
"the",
"request",
"otherwise",
"it",
"populates",
"finalReport"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/Timer.java#L155-L166 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/streaming/StreamWriter.java | StreamWriter.write | public void write(WritableByteChannel channel) throws IOException
{
long totalSize = totalSize();
RandomAccessReader file = sstable.openDataReader();
ChecksumValidator validator = new File(sstable.descriptor.filenameFor(Component.CRC)).exists()
? DataInteg... | java | public void write(WritableByteChannel channel) throws IOException
{
long totalSize = totalSize();
RandomAccessReader file = sstable.openDataReader();
ChecksumValidator validator = new File(sstable.descriptor.filenameFor(Component.CRC)).exists()
? DataInteg... | [
"public",
"void",
"write",
"(",
"WritableByteChannel",
"channel",
")",
"throws",
"IOException",
"{",
"long",
"totalSize",
"=",
"totalSize",
"(",
")",
";",
"RandomAccessReader",
"file",
"=",
"sstable",
".",
"openDataReader",
"(",
")",
";",
"ChecksumValidator",
"v... | Stream file of specified sections to given channel.
StreamWriter uses LZF compression on wire to decrease size to transfer.
@param channel where this writes data to
@throws IOException on any I/O error | [
"Stream",
"file",
"of",
"specified",
"sections",
"to",
"given",
"channel",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/StreamWriter.java#L71-L119 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/streaming/StreamWriter.java | StreamWriter.write | protected long write(RandomAccessReader reader, ChecksumValidator validator, int start, long length, long bytesTransferred) throws IOException
{
int toTransfer = (int) Math.min(transferBuffer.length, length - bytesTransferred);
int minReadable = (int) Math.min(transferBuffer.length, reader.length() ... | java | protected long write(RandomAccessReader reader, ChecksumValidator validator, int start, long length, long bytesTransferred) throws IOException
{
int toTransfer = (int) Math.min(transferBuffer.length, length - bytesTransferred);
int minReadable = (int) Math.min(transferBuffer.length, reader.length() ... | [
"protected",
"long",
"write",
"(",
"RandomAccessReader",
"reader",
",",
"ChecksumValidator",
"validator",
",",
"int",
"start",
",",
"long",
"length",
",",
"long",
"bytesTransferred",
")",
"throws",
"IOException",
"{",
"int",
"toTransfer",
"=",
"(",
"int",
")",
... | Sequentially read bytes from the file and write them to the output stream
@param reader The file reader to read from
@param validator validator to verify data integrity
@param start number of bytes to skip transfer, but include for validation.
@param length The full length that should be read from {@code reader}
@para... | [
"Sequentially",
"read",
"bytes",
"from",
"the",
"file",
"and",
"write",
"them",
"to",
"the",
"output",
"stream"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/StreamWriter.java#L142-L155 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/ObjectSizes.java | ObjectSizes.sizeOnHeapOf | public static long sizeOnHeapOf(ByteBuffer[] array)
{
long allElementsSize = 0;
for (int i = 0; i < array.length; i++)
if (array[i] != null)
allElementsSize += sizeOnHeapOf(array[i]);
return allElementsSize + sizeOfArray(array);
} | java | public static long sizeOnHeapOf(ByteBuffer[] array)
{
long allElementsSize = 0;
for (int i = 0; i < array.length; i++)
if (array[i] != null)
allElementsSize += sizeOnHeapOf(array[i]);
return allElementsSize + sizeOfArray(array);
} | [
"public",
"static",
"long",
"sizeOnHeapOf",
"(",
"ByteBuffer",
"[",
"]",
"array",
")",
"{",
"long",
"allElementsSize",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"if",
"(",
"array",
... | Memory a ByteBuffer array consumes. | [
"Memory",
"a",
"ByteBuffer",
"array",
"consumes",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/ObjectSizes.java#L100-L108 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/ObjectSizes.java | ObjectSizes.sizeOnHeapOf | public static long sizeOnHeapOf(ByteBuffer buffer)
{
if (buffer.isDirect())
return BUFFER_EMPTY_SIZE;
// if we're only referencing a sub-portion of the ByteBuffer, don't count the array overhead (assume it's slab
// allocated, so amortized over all the allocations the overhead is... | java | public static long sizeOnHeapOf(ByteBuffer buffer)
{
if (buffer.isDirect())
return BUFFER_EMPTY_SIZE;
// if we're only referencing a sub-portion of the ByteBuffer, don't count the array overhead (assume it's slab
// allocated, so amortized over all the allocations the overhead is... | [
"public",
"static",
"long",
"sizeOnHeapOf",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"if",
"(",
"buffer",
".",
"isDirect",
"(",
")",
")",
"return",
"BUFFER_EMPTY_SIZE",
";",
"// if we're only referencing a sub-portion of the ByteBuffer, don't count the array overhead (assume it... | Memory a byte buffer consumes
@param buffer ByteBuffer to calculate in memory size
@return Total in-memory size of the byte buffer | [
"Memory",
"a",
"byte",
"buffer",
"consumes"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/ObjectSizes.java#L119-L128 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java | DebuggableThreadPoolExecutor.createWithMaximumPoolSize | public static DebuggableThreadPoolExecutor createWithMaximumPoolSize(String threadPoolName, int size, int keepAliveTime, TimeUnit unit)
{
return new DebuggableThreadPoolExecutor(size, Integer.MAX_VALUE, keepAliveTime, unit, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(threadPoolName));
} | java | public static DebuggableThreadPoolExecutor createWithMaximumPoolSize(String threadPoolName, int size, int keepAliveTime, TimeUnit unit)
{
return new DebuggableThreadPoolExecutor(size, Integer.MAX_VALUE, keepAliveTime, unit, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory(threadPoolName));
} | [
"public",
"static",
"DebuggableThreadPoolExecutor",
"createWithMaximumPoolSize",
"(",
"String",
"threadPoolName",
",",
"int",
"size",
",",
"int",
"keepAliveTime",
",",
"TimeUnit",
"unit",
")",
"{",
"return",
"new",
"DebuggableThreadPoolExecutor",
"(",
"size",
",",
"In... | Returns a ThreadPoolExecutor with a fixed maximum number of threads, but whose
threads are terminated when idle for too long.
When all threads are actively executing tasks, new tasks are queued.
@param threadPoolName the name of the threads created by this executor
@param size the maximum number of threads for this exe... | [
"Returns",
"a",
"ThreadPoolExecutor",
"with",
"a",
"fixed",
"maximum",
"number",
"of",
"threads",
"but",
"whose",
"threads",
"are",
"terminated",
"when",
"idle",
"for",
"too",
"long",
".",
"When",
"all",
"threads",
"are",
"actively",
"executing",
"tasks",
"new... | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java#L125-L128 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java | DebuggableThreadPoolExecutor.execute | @Override
public void execute(Runnable command)
{
super.execute(isTracing() && !(command instanceof TraceSessionWrapper)
? new TraceSessionWrapper<Object>(Executors.callable(command, null))
: command);
} | java | @Override
public void execute(Runnable command)
{
super.execute(isTracing() && !(command instanceof TraceSessionWrapper)
? new TraceSessionWrapper<Object>(Executors.callable(command, null))
: command);
} | [
"@",
"Override",
"public",
"void",
"execute",
"(",
"Runnable",
"command",
")",
"{",
"super",
".",
"execute",
"(",
"isTracing",
"(",
")",
"&&",
"!",
"(",
"command",
"instanceof",
"TraceSessionWrapper",
")",
"?",
"new",
"TraceSessionWrapper",
"<",
"Object",
">... | execute does not call newTaskFor | [
"execute",
"does",
"not",
"call",
"newTaskFor"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/DebuggableThreadPoolExecutor.java#L147-L153 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeCLIStatement | public void executeCLIStatement(String statement) throws CharacterCodingException, TException, TimedOutException, NotFoundException, NoSuchFieldException, InvalidRequestException, UnavailableException, InstantiationException, IllegalAccessException
{
Tree tree = CliCompiler.compileQuery(statement);
... | java | public void executeCLIStatement(String statement) throws CharacterCodingException, TException, TimedOutException, NotFoundException, NoSuchFieldException, InvalidRequestException, UnavailableException, InstantiationException, IllegalAccessException
{
Tree tree = CliCompiler.compileQuery(statement);
... | [
"public",
"void",
"executeCLIStatement",
"(",
"String",
"statement",
")",
"throws",
"CharacterCodingException",
",",
"TException",
",",
"TimedOutException",
",",
"NotFoundException",
",",
"NoSuchFieldException",
",",
"InvalidRequestException",
",",
"UnavailableException",
"... | Execute a CLI Statement | [
"Execute",
"a",
"CLI",
"Statement"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L214-L323 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeSet | private void executeSet(Tree statement)
throws TException, InvalidRequestException, UnavailableException, TimedOutException
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
long startTime = System.nanoTime();
// ^(NODE_COLUMN_ACCESS <cf> <key> <column>)
Tr... | java | private void executeSet(Tree statement)
throws TException, InvalidRequestException, UnavailableException, TimedOutException
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
long startTime = System.nanoTime();
// ^(NODE_COLUMN_ACCESS <cf> <key> <column>)
Tr... | [
"private",
"void",
"executeSet",
"(",
"Tree",
"statement",
")",
"throws",
"TException",
",",
"InvalidRequestException",
",",
"UnavailableException",
",",
"TimedOutException",
"{",
"if",
"(",
"!",
"CliMain",
".",
"isConnected",
"(",
")",
"||",
"!",
"hasKeySpace",
... | Execute SET statement | [
"Execute",
"SET",
"statement"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L905-L992 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeIncr | private void executeIncr(Tree statement, long multiplier)
throws TException, NotFoundException, InvalidRequestException, UnavailableException, TimedOutException
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
Tree columnFamilySpec = statement.getChild(0);
St... | java | private void executeIncr(Tree statement, long multiplier)
throws TException, NotFoundException, InvalidRequestException, UnavailableException, TimedOutException
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
Tree columnFamilySpec = statement.getChild(0);
St... | [
"private",
"void",
"executeIncr",
"(",
"Tree",
"statement",
",",
"long",
"multiplier",
")",
"throws",
"TException",
",",
"NotFoundException",
",",
"InvalidRequestException",
",",
"UnavailableException",
",",
"TimedOutException",
"{",
"if",
"(",
"!",
"CliMain",
".",
... | Execute INCR statement | [
"Execute",
"INCR",
"statement"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L995-L1059 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeAddKeySpace | private void executeAddKeySpace(Tree statement)
{
if (!CliMain.isConnected())
return;
// first value is the keyspace name, after that it is all key=value
String keyspaceName = CliUtils.unescapeSQLString(statement.getChild(0).getText());
KsDef ksDef = new KsDef(keyspaceN... | java | private void executeAddKeySpace(Tree statement)
{
if (!CliMain.isConnected())
return;
// first value is the keyspace name, after that it is all key=value
String keyspaceName = CliUtils.unescapeSQLString(statement.getChild(0).getText());
KsDef ksDef = new KsDef(keyspaceN... | [
"private",
"void",
"executeAddKeySpace",
"(",
"Tree",
"statement",
")",
"{",
"if",
"(",
"!",
"CliMain",
".",
"isConnected",
"(",
")",
")",
"return",
";",
"// first value is the keyspace name, after that it is all key=value",
"String",
"keyspaceName",
"=",
"CliUtils",
... | Add a keyspace
@param statement - a token tree representing current statement | [
"Add",
"a",
"keyspace"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1073-L1098 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeAddColumnFamily | private void executeAddColumnFamily(Tree statement)
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
// first value is the column family name, after that it is all key=value
CfDef cfDef = new CfDef(keySpace, CliUtils.unescapeSQLString(statement.getChild(0).getText()));
... | java | private void executeAddColumnFamily(Tree statement)
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
// first value is the column family name, after that it is all key=value
CfDef cfDef = new CfDef(keySpace, CliUtils.unescapeSQLString(statement.getChild(0).getText()));
... | [
"private",
"void",
"executeAddColumnFamily",
"(",
"Tree",
"statement",
")",
"{",
"if",
"(",
"!",
"CliMain",
".",
"isConnected",
"(",
")",
"||",
"!",
"hasKeySpace",
"(",
")",
")",
"return",
";",
"// first value is the column family name, after that it is all key=value"... | Add a column family
@param statement - a token tree representing current statement | [
"Add",
"a",
"column",
"family"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1105-L1127 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeUpdateKeySpace | private void executeUpdateKeySpace(Tree statement)
{
if (!CliMain.isConnected())
return;
try
{
String keyspaceName = CliCompiler.getKeySpace(statement, thriftClient.describe_keyspaces());
KsDef currentKsDef = getKSMetaData(keyspaceName);
KsDe... | java | private void executeUpdateKeySpace(Tree statement)
{
if (!CliMain.isConnected())
return;
try
{
String keyspaceName = CliCompiler.getKeySpace(statement, thriftClient.describe_keyspaces());
KsDef currentKsDef = getKSMetaData(keyspaceName);
KsDe... | [
"private",
"void",
"executeUpdateKeySpace",
"(",
"Tree",
"statement",
")",
"{",
"if",
"(",
"!",
"CliMain",
".",
"isConnected",
"(",
")",
")",
"return",
";",
"try",
"{",
"String",
"keyspaceName",
"=",
"CliCompiler",
".",
"getKeySpace",
"(",
"statement",
",",
... | Update existing keyspace identified by name
@param statement - tree represeting statement | [
"Update",
"existing",
"keyspace",
"identified",
"by",
"name"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1133-L1158 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeUpdateColumnFamily | private void executeUpdateColumnFamily(Tree statement)
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
String cfName = CliCompiler.getColumnFamily(statement, currentCfDefs());
try
{
// request correct cfDef from the server (we let that call include C... | java | private void executeUpdateColumnFamily(Tree statement)
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
String cfName = CliCompiler.getColumnFamily(statement, currentCfDefs());
try
{
// request correct cfDef from the server (we let that call include C... | [
"private",
"void",
"executeUpdateColumnFamily",
"(",
"Tree",
"statement",
")",
"{",
"if",
"(",
"!",
"CliMain",
".",
"isConnected",
"(",
")",
"||",
"!",
"hasKeySpace",
"(",
")",
")",
"return",
";",
"String",
"cfName",
"=",
"CliCompiler",
".",
"getColumnFamily... | Update existing column family identified by name
@param statement - tree represeting statement | [
"Update",
"existing",
"column",
"family",
"identified",
"by",
"name"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1164-L1193 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.updateKsDefAttributes | private KsDef updateKsDefAttributes(Tree statement, KsDef ksDefToUpdate)
{
KsDef ksDef = new KsDef(ksDefToUpdate);
// removing all column definitions - thrift system_update_keyspace method requires that
ksDef.setCf_defs(new LinkedList<CfDef>());
for(int i = 1; i < statement.getChil... | java | private KsDef updateKsDefAttributes(Tree statement, KsDef ksDefToUpdate)
{
KsDef ksDef = new KsDef(ksDefToUpdate);
// removing all column definitions - thrift system_update_keyspace method requires that
ksDef.setCf_defs(new LinkedList<CfDef>());
for(int i = 1; i < statement.getChil... | [
"private",
"KsDef",
"updateKsDefAttributes",
"(",
"Tree",
"statement",
",",
"KsDef",
"ksDefToUpdate",
")",
"{",
"KsDef",
"ksDef",
"=",
"new",
"KsDef",
"(",
"ksDefToUpdate",
")",
";",
"// removing all column definitions - thrift system_update_keyspace method requires that",
... | Used to update keyspace definition attributes
@param statement - ANTRL tree representing current statement
@param ksDefToUpdate - keyspace definition to update
@return ksDef - updated keyspace definition | [
"Used",
"to",
"update",
"keyspace",
"definition",
"attributes"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1201-L1254 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeDelKeySpace | private void executeDelKeySpace(Tree statement)
throws TException, InvalidRequestException, NotFoundException, SchemaDisagreementException
{
if (!CliMain.isConnected())
return;
String keyspaceName = CliCompiler.getKeySpace(statement, thriftClient.describe_keyspaces());
... | java | private void executeDelKeySpace(Tree statement)
throws TException, InvalidRequestException, NotFoundException, SchemaDisagreementException
{
if (!CliMain.isConnected())
return;
String keyspaceName = CliCompiler.getKeySpace(statement, thriftClient.describe_keyspaces());
... | [
"private",
"void",
"executeDelKeySpace",
"(",
"Tree",
"statement",
")",
"throws",
"TException",
",",
"InvalidRequestException",
",",
"NotFoundException",
",",
"SchemaDisagreementException",
"{",
"if",
"(",
"!",
"CliMain",
".",
"isConnected",
"(",
")",
")",
"return",... | Delete a keyspace
@param statement - a token tree representing current statement
@throws TException - exception
@throws InvalidRequestException - exception
@throws NotFoundException - exception
@throws SchemaDisagreementException | [
"Delete",
"a",
"keyspace"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1389-L1401 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.executeDelColumnFamily | private void executeDelColumnFamily(Tree statement)
throws TException, InvalidRequestException, NotFoundException, SchemaDisagreementException
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
String cfName = CliCompiler.getColumnFamily(statement, currentCfDefs());
... | java | private void executeDelColumnFamily(Tree statement)
throws TException, InvalidRequestException, NotFoundException, SchemaDisagreementException
{
if (!CliMain.isConnected() || !hasKeySpace())
return;
String cfName = CliCompiler.getColumnFamily(statement, currentCfDefs());
... | [
"private",
"void",
"executeDelColumnFamily",
"(",
"Tree",
"statement",
")",
"throws",
"TException",
",",
"InvalidRequestException",
",",
"NotFoundException",
",",
"SchemaDisagreementException",
"{",
"if",
"(",
"!",
"CliMain",
".",
"isConnected",
"(",
")",
"||",
"!",... | Delete a column family
@param statement - a token tree representing current statement
@throws TException - exception
@throws InvalidRequestException - exception
@throws NotFoundException - exception
@throws SchemaDisagreementException | [
"Delete",
"a",
"column",
"family"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1411-L1420 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.showKeyspace | private void showKeyspace(PrintStream output, KsDef ksDef)
{
output.append("create keyspace ").append(CliUtils.maybeEscapeName(ksDef.name));
writeAttr(output, true, "placement_strategy", normaliseType(ksDef.strategy_class, "org.apache.cassandra.locator"));
if (ksDef.strategy_options != nul... | java | private void showKeyspace(PrintStream output, KsDef ksDef)
{
output.append("create keyspace ").append(CliUtils.maybeEscapeName(ksDef.name));
writeAttr(output, true, "placement_strategy", normaliseType(ksDef.strategy_class, "org.apache.cassandra.locator"));
if (ksDef.strategy_options != nul... | [
"private",
"void",
"showKeyspace",
"(",
"PrintStream",
"output",
",",
"KsDef",
"ksDef",
")",
"{",
"output",
".",
"append",
"(",
"\"create keyspace \"",
")",
".",
"append",
"(",
"CliUtils",
".",
"maybeEscapeName",
"(",
"ksDef",
".",
"name",
")",
")",
";",
"... | Creates a CLI script to create the Keyspace it's Column Families
@param output StringBuilder to write to.
@param ksDef KsDef to create the cli script for. | [
"Creates",
"a",
"CLI",
"script",
"to",
"create",
"the",
"Keyspace",
"it",
"s",
"Column",
"Families"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1766-L1908 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.showColumnMeta | private void showColumnMeta(PrintStream output, CfDef cfDef, ColumnDef colDef)
{
output.append(NEWLINE + TAB + TAB + "{");
final AbstractType<?> comparator = getFormatType(cfDef.column_type.equals("Super")
? cfDef.subcomparator_type
... | java | private void showColumnMeta(PrintStream output, CfDef cfDef, ColumnDef colDef)
{
output.append(NEWLINE + TAB + TAB + "{");
final AbstractType<?> comparator = getFormatType(cfDef.column_type.equals("Super")
? cfDef.subcomparator_type
... | [
"private",
"void",
"showColumnMeta",
"(",
"PrintStream",
"output",
",",
"CfDef",
"cfDef",
",",
"ColumnDef",
"colDef",
")",
"{",
"output",
".",
"append",
"(",
"NEWLINE",
"+",
"TAB",
"+",
"TAB",
"+",
"\"{\"",
")",
";",
"final",
"AbstractType",
"<",
"?",
">... | Writes the supplied ColumnDef to the StringBuilder as a cli script.
@param output The File to write to.
@param cfDef The CfDef as a source for comparator/validator
@param colDef The Column Definition to export | [
"Writes",
"the",
"supplied",
"ColumnDef",
"to",
"the",
"StringBuilder",
"as",
"a",
"cli",
"script",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1917-L1955 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.hasKeySpace | private boolean hasKeySpace(boolean printError)
{
boolean hasKeyspace = keySpace != null;
if (!hasKeyspace && printError)
sessionState.err.println("Not authorized to a working keyspace.");
return hasKeyspace;
} | java | private boolean hasKeySpace(boolean printError)
{
boolean hasKeyspace = keySpace != null;
if (!hasKeyspace && printError)
sessionState.err.println("Not authorized to a working keyspace.");
return hasKeyspace;
} | [
"private",
"boolean",
"hasKeySpace",
"(",
"boolean",
"printError",
")",
"{",
"boolean",
"hasKeyspace",
"=",
"keySpace",
"!=",
"null",
";",
"if",
"(",
"!",
"hasKeyspace",
"&&",
"printError",
")",
"sessionState",
".",
"err",
".",
"println",
"(",
"\"Not authorize... | Returns true if this.keySpace is set, false otherwise
@return boolean | [
"Returns",
"true",
"if",
"this",
".",
"keySpace",
"is",
"set",
"false",
"otherwise"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L1990-L1998 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.getIndexTypeFromString | private IndexType getIndexTypeFromString(String indexTypeAsString)
{
IndexType indexType;
try
{
indexType = IndexType.findByValue(new Integer(indexTypeAsString));
}
catch (NumberFormatException e)
{
try
{
// if this... | java | private IndexType getIndexTypeFromString(String indexTypeAsString)
{
IndexType indexType;
try
{
indexType = IndexType.findByValue(new Integer(indexTypeAsString));
}
catch (NumberFormatException e)
{
try
{
// if this... | [
"private",
"IndexType",
"getIndexTypeFromString",
"(",
"String",
"indexTypeAsString",
")",
"{",
"IndexType",
"indexType",
";",
"try",
"{",
"indexType",
"=",
"IndexType",
".",
"findByValue",
"(",
"new",
"Integer",
"(",
"indexTypeAsString",
")",
")",
";",
"}",
"ca... | Getting IndexType object from indexType string
@param indexTypeAsString - string return by parser corresponding to IndexType
@return IndexType - an IndexType object | [
"Getting",
"IndexType",
"object",
"from",
"indexType",
"string"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2516-L2543 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.subColumnNameAsBytes | private ByteBuffer subColumnNameAsBytes(String superColumn, String columnFamily)
{
CfDef columnFamilyDef = getCfDef(columnFamily);
return subColumnNameAsBytes(superColumn, columnFamilyDef);
} | java | private ByteBuffer subColumnNameAsBytes(String superColumn, String columnFamily)
{
CfDef columnFamilyDef = getCfDef(columnFamily);
return subColumnNameAsBytes(superColumn, columnFamilyDef);
} | [
"private",
"ByteBuffer",
"subColumnNameAsBytes",
"(",
"String",
"superColumn",
",",
"String",
"columnFamily",
")",
"{",
"CfDef",
"columnFamilyDef",
"=",
"getCfDef",
"(",
"columnFamily",
")",
";",
"return",
"subColumnNameAsBytes",
"(",
"superColumn",
",",
"columnFamily... | Converts sub-column name into ByteBuffer according to comparator type
@param superColumn - sub-column name from parser
@param columnFamily - column family name from parser
@return ByteBuffer bytes - into which column name was converted according to comparator type | [
"Converts",
"sub",
"-",
"column",
"name",
"into",
"ByteBuffer",
"according",
"to",
"comparator",
"type"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2617-L2621 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.subColumnNameAsBytes | private ByteBuffer subColumnNameAsBytes(String superColumn, CfDef columnFamilyDef)
{
String comparatorClass = columnFamilyDef.subcomparator_type;
if (comparatorClass == null)
{
sessionState.out.println(String.format("Notice: defaulting to BytesType subcomparator for '%s'", colum... | java | private ByteBuffer subColumnNameAsBytes(String superColumn, CfDef columnFamilyDef)
{
String comparatorClass = columnFamilyDef.subcomparator_type;
if (comparatorClass == null)
{
sessionState.out.println(String.format("Notice: defaulting to BytesType subcomparator for '%s'", colum... | [
"private",
"ByteBuffer",
"subColumnNameAsBytes",
"(",
"String",
"superColumn",
",",
"CfDef",
"columnFamilyDef",
")",
"{",
"String",
"comparatorClass",
"=",
"columnFamilyDef",
".",
"subcomparator_type",
";",
"if",
"(",
"comparatorClass",
"==",
"null",
")",
"{",
"sess... | Converts column name into ByteBuffer according to comparator type
@param superColumn - sub-column name from parser
@param columnFamilyDef - column family from parser
@return ByteBuffer bytes - into which column name was converted according to comparator type | [
"Converts",
"column",
"name",
"into",
"ByteBuffer",
"according",
"to",
"comparator",
"type"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2629-L2640 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.getValidatorForValue | private AbstractType<?> getValidatorForValue(CfDef cfDef, byte[] columnNameInBytes)
{
String defaultValidator = cfDef.default_validation_class;
for (ColumnDef columnDefinition : cfDef.getColumn_metadata())
{
byte[] nameInBytes = columnDefinition.getName();
if (Array... | java | private AbstractType<?> getValidatorForValue(CfDef cfDef, byte[] columnNameInBytes)
{
String defaultValidator = cfDef.default_validation_class;
for (ColumnDef columnDefinition : cfDef.getColumn_metadata())
{
byte[] nameInBytes = columnDefinition.getName();
if (Array... | [
"private",
"AbstractType",
"<",
"?",
">",
"getValidatorForValue",
"(",
"CfDef",
"cfDef",
",",
"byte",
"[",
"]",
"columnNameInBytes",
")",
"{",
"String",
"defaultValidator",
"=",
"cfDef",
".",
"default_validation_class",
";",
"for",
"(",
"ColumnDef",
"columnDefinit... | Get validator for specific column value
@param cfDef - CfDef object representing column family with metadata
@param columnNameInBytes - column name as byte array
@return AbstractType - validator for column value | [
"Get",
"validator",
"for",
"specific",
"column",
"value"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2692-L2712 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.getTypeByFunction | public static AbstractType<?> getTypeByFunction(String functionName)
{
Function function;
try
{
function = Function.valueOf(functionName.toUpperCase());
}
catch (IllegalArgumentException e)
{
String message = String.format("Function '%s' not f... | java | public static AbstractType<?> getTypeByFunction(String functionName)
{
Function function;
try
{
function = Function.valueOf(functionName.toUpperCase());
}
catch (IllegalArgumentException e)
{
String message = String.format("Function '%s' not f... | [
"public",
"static",
"AbstractType",
"<",
"?",
">",
"getTypeByFunction",
"(",
"String",
"functionName",
")",
"{",
"Function",
"function",
";",
"try",
"{",
"function",
"=",
"Function",
".",
"valueOf",
"(",
"functionName",
".",
"toUpperCase",
"(",
")",
")",
";"... | Get AbstractType by function name
@param functionName - name of the function e.g. utf8, integer, long etc.
@return AbstractType type corresponding to the function name | [
"Get",
"AbstractType",
"by",
"function",
"name"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2827-L2842 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.updateColumnMetaData | private void updateColumnMetaData(CfDef columnFamily, ByteBuffer columnName, String validationClass)
{
ColumnDef column = getColumnDefByName(columnFamily, columnName);
if (column != null)
{
// if validation class is the same - no need to modify it
if (column.getValid... | java | private void updateColumnMetaData(CfDef columnFamily, ByteBuffer columnName, String validationClass)
{
ColumnDef column = getColumnDefByName(columnFamily, columnName);
if (column != null)
{
// if validation class is the same - no need to modify it
if (column.getValid... | [
"private",
"void",
"updateColumnMetaData",
"(",
"CfDef",
"columnFamily",
",",
"ByteBuffer",
"columnName",
",",
"String",
"validationClass",
")",
"{",
"ColumnDef",
"column",
"=",
"getColumnDefByName",
"(",
"columnFamily",
",",
"columnName",
")",
";",
"if",
"(",
"co... | Used to locally update column family definition with new column metadata
@param columnFamily - CfDef record
@param columnName - column name represented as byte[]
@param validationClass - value validation class | [
"Used",
"to",
"locally",
"update",
"column",
"family",
"definition",
"with",
"new",
"column",
"metadata"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2850-L2869 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.getColumnDefByName | private ColumnDef getColumnDefByName(CfDef columnFamily, ByteBuffer columnName)
{
for (ColumnDef columnDef : columnFamily.getColumn_metadata())
{
byte[] currName = columnDef.getName();
if (ByteBufferUtil.compare(currName, columnName) == 0)
{
retur... | java | private ColumnDef getColumnDefByName(CfDef columnFamily, ByteBuffer columnName)
{
for (ColumnDef columnDef : columnFamily.getColumn_metadata())
{
byte[] currName = columnDef.getName();
if (ByteBufferUtil.compare(currName, columnName) == 0)
{
retur... | [
"private",
"ColumnDef",
"getColumnDefByName",
"(",
"CfDef",
"columnFamily",
",",
"ByteBuffer",
"columnName",
")",
"{",
"for",
"(",
"ColumnDef",
"columnDef",
":",
"columnFamily",
".",
"getColumn_metadata",
"(",
")",
")",
"{",
"byte",
"[",
"]",
"currName",
"=",
... | Get specific ColumnDef in column family meta data by column name
@param columnFamily - CfDef record
@param columnName - column name represented as byte[]
@return ColumnDef - found column definition | [
"Get",
"specific",
"ColumnDef",
"in",
"column",
"family",
"meta",
"data",
"by",
"column",
"name"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2877-L2890 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.formatSubcolumnName | private String formatSubcolumnName(String keyspace, String columnFamily, ByteBuffer name)
{
return getFormatType(getCfDef(keyspace, columnFamily).subcomparator_type).getString(name);
} | java | private String formatSubcolumnName(String keyspace, String columnFamily, ByteBuffer name)
{
return getFormatType(getCfDef(keyspace, columnFamily).subcomparator_type).getString(name);
} | [
"private",
"String",
"formatSubcolumnName",
"(",
"String",
"keyspace",
",",
"String",
"columnFamily",
",",
"ByteBuffer",
"name",
")",
"{",
"return",
"getFormatType",
"(",
"getCfDef",
"(",
"keyspace",
",",
"columnFamily",
")",
".",
"subcomparator_type",
")",
".",
... | returns sub-column name in human-readable format | [
"returns",
"sub",
"-",
"column",
"name",
"in",
"human",
"-",
"readable",
"format"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2971-L2974 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.formatColumnName | private String formatColumnName(String keyspace, String columnFamily, ByteBuffer name)
{
return getFormatType(getCfDef(keyspace, columnFamily).comparator_type).getString(name);
} | java | private String formatColumnName(String keyspace, String columnFamily, ByteBuffer name)
{
return getFormatType(getCfDef(keyspace, columnFamily).comparator_type).getString(name);
} | [
"private",
"String",
"formatColumnName",
"(",
"String",
"keyspace",
",",
"String",
"columnFamily",
",",
"ByteBuffer",
"name",
")",
"{",
"return",
"getFormatType",
"(",
"getCfDef",
"(",
"keyspace",
",",
"columnFamily",
")",
".",
"comparator_type",
")",
".",
"getS... | retuns column name in human-readable format | [
"retuns",
"column",
"name",
"in",
"human",
"-",
"readable",
"format"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L2977-L2980 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cli/CliClient.java | CliClient.elapsedTime | private void elapsedTime(long startTime)
{
/** time elapsed in nanoseconds */
long eta = System.nanoTime() - startTime;
sessionState.out.print("Elapsed time: ");
if (eta < 10000000)
{
sessionState.out.print(Math.round(eta/10000.0)/100.0);
}
else
... | java | private void elapsedTime(long startTime)
{
/** time elapsed in nanoseconds */
long eta = System.nanoTime() - startTime;
sessionState.out.print("Elapsed time: ");
if (eta < 10000000)
{
sessionState.out.print(Math.round(eta/10000.0)/100.0);
}
else
... | [
"private",
"void",
"elapsedTime",
"(",
"long",
"startTime",
")",
"{",
"/** time elapsed in nanoseconds */",
"long",
"eta",
"=",
"System",
".",
"nanoTime",
"(",
")",
"-",
"startTime",
";",
"sessionState",
".",
"out",
".",
"print",
"(",
"\"Elapsed time: \"",
")",
... | Print elapsed time. Print 2 fraction digits if eta is under 10 ms.
@param startTime starting time in nanoseconds | [
"Print",
"elapsed",
"time",
".",
"Print",
"2",
"fraction",
"digits",
"if",
"eta",
"is",
"under",
"10",
"ms",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cli/CliClient.java#L3048-L3063 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/util/MappedFileDataInput.java | MappedFileDataInput.seek | public void seek(long pos) throws IOException
{
long inSegmentPos = pos - segmentOffset;
if (inSegmentPos < 0 || inSegmentPos > buffer.capacity())
throw new IOException(String.format("Seek position %d is not within mmap segment (seg offs: %d, length: %d)", pos, segmentOffset, buffer.capa... | java | public void seek(long pos) throws IOException
{
long inSegmentPos = pos - segmentOffset;
if (inSegmentPos < 0 || inSegmentPos > buffer.capacity())
throw new IOException(String.format("Seek position %d is not within mmap segment (seg offs: %d, length: %d)", pos, segmentOffset, buffer.capa... | [
"public",
"void",
"seek",
"(",
"long",
"pos",
")",
"throws",
"IOException",
"{",
"long",
"inSegmentPos",
"=",
"pos",
"-",
"segmentOffset",
";",
"if",
"(",
"inSegmentPos",
"<",
"0",
"||",
"inSegmentPos",
">",
"buffer",
".",
"capacity",
"(",
")",
")",
"thr... | IOException otherwise. | [
"IOException",
"otherwise",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/util/MappedFileDataInput.java#L51-L58 | train |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/RowIndex.java | RowIndex.index | @Override
public void index(ByteBuffer key, ColumnFamily columnFamily) {
Log.debug("Indexing row %s in index %s ", key, logName);
lock.readLock().lock();
try {
if (rowService != null) {
long timestamp = System.currentTimeMillis();
rowService.index(... | java | @Override
public void index(ByteBuffer key, ColumnFamily columnFamily) {
Log.debug("Indexing row %s in index %s ", key, logName);
lock.readLock().lock();
try {
if (rowService != null) {
long timestamp = System.currentTimeMillis();
rowService.index(... | [
"@",
"Override",
"public",
"void",
"index",
"(",
"ByteBuffer",
"key",
",",
"ColumnFamily",
"columnFamily",
")",
"{",
"Log",
".",
"debug",
"(",
"\"Indexing row %s in index %s \"",
",",
"key",
",",
"logName",
")",
";",
"lock",
".",
"readLock",
"(",
")",
".",
... | Index the given row.
@param key The partition key.
@param columnFamily The column family data to be indexed | [
"Index",
"the",
"given",
"row",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/RowIndex.java#L148-L163 | train |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/RowIndex.java | RowIndex.delete | @Override
public void delete(DecoratedKey key, OpOrder.Group opGroup) {
Log.debug("Removing row %s from index %s", key, logName);
lock.writeLock().lock();
try {
rowService.delete(key);
rowService = null;
} catch (RuntimeException e) {
Log.error(e, ... | java | @Override
public void delete(DecoratedKey key, OpOrder.Group opGroup) {
Log.debug("Removing row %s from index %s", key, logName);
lock.writeLock().lock();
try {
rowService.delete(key);
rowService = null;
} catch (RuntimeException e) {
Log.error(e, ... | [
"@",
"Override",
"public",
"void",
"delete",
"(",
"DecoratedKey",
"key",
",",
"OpOrder",
".",
"Group",
"opGroup",
")",
"{",
"Log",
".",
"debug",
"(",
"\"Removing row %s from index %s\"",
",",
"key",
",",
"logName",
")",
";",
"lock",
".",
"writeLock",
"(",
... | cleans up deleted columns from cassandra cleanup compaction
@param key The partition key of the physical row to be deleted. | [
"cleans",
"up",
"deleted",
"columns",
"from",
"cassandra",
"cleanup",
"compaction"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/RowIndex.java#L170-L183 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/repair/RepairJob.java | RepairJob.sendTreeRequests | public void sendTreeRequests(Collection<InetAddress> endpoints)
{
// send requests to all nodes
List<InetAddress> allEndpoints = new ArrayList<>(endpoints);
allEndpoints.add(FBUtilities.getBroadcastAddress());
// Create a snapshot at all nodes unless we're using pure parallel repair... | java | public void sendTreeRequests(Collection<InetAddress> endpoints)
{
// send requests to all nodes
List<InetAddress> allEndpoints = new ArrayList<>(endpoints);
allEndpoints.add(FBUtilities.getBroadcastAddress());
// Create a snapshot at all nodes unless we're using pure parallel repair... | [
"public",
"void",
"sendTreeRequests",
"(",
"Collection",
"<",
"InetAddress",
">",
"endpoints",
")",
"{",
"// send requests to all nodes",
"List",
"<",
"InetAddress",
">",
"allEndpoints",
"=",
"new",
"ArrayList",
"<>",
"(",
"endpoints",
")",
";",
"allEndpoints",
".... | Send merkle tree request to every involved neighbor. | [
"Send",
"merkle",
"tree",
"request",
"to",
"every",
"involved",
"neighbor",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/RepairJob.java#L117-L155 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/repair/RepairJob.java | RepairJob.addTree | public synchronized int addTree(InetAddress endpoint, MerkleTree tree)
{
// Wait for all request to have been performed (see #3400)
try
{
requestsSent.await();
}
catch (InterruptedException e)
{
throw new AssertionError("Interrupted while waiti... | java | public synchronized int addTree(InetAddress endpoint, MerkleTree tree)
{
// Wait for all request to have been performed (see #3400)
try
{
requestsSent.await();
}
catch (InterruptedException e)
{
throw new AssertionError("Interrupted while waiti... | [
"public",
"synchronized",
"int",
"addTree",
"(",
"InetAddress",
"endpoint",
",",
"MerkleTree",
"tree",
")",
"{",
"// Wait for all request to have been performed (see #3400)",
"try",
"{",
"requestsSent",
".",
"await",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedExcep... | Add a new received tree and return the number of remaining tree to
be received for the job to be complete.
Callers may assume exactly one addTree call will result in zero remaining endpoints.
@param endpoint address of the endpoint that sent response
@param tree sent Merkle tree or null if validation failed on endpoi... | [
"Add",
"a",
"new",
"received",
"tree",
"and",
"return",
"the",
"number",
"of",
"remaining",
"tree",
"to",
"be",
"received",
"for",
"the",
"job",
"to",
"be",
"complete",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/repair/RepairJob.java#L178-L195 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/marshal/AbstractType.java | AbstractType.getString | public String getString(ByteBuffer bytes)
{
TypeSerializer<T> serializer = getSerializer();
serializer.validate(bytes);
return serializer.toString(serializer.deserialize(bytes));
} | java | public String getString(ByteBuffer bytes)
{
TypeSerializer<T> serializer = getSerializer();
serializer.validate(bytes);
return serializer.toString(serializer.deserialize(bytes));
} | [
"public",
"String",
"getString",
"(",
"ByteBuffer",
"bytes",
")",
"{",
"TypeSerializer",
"<",
"T",
">",
"serializer",
"=",
"getSerializer",
"(",
")",
";",
"serializer",
".",
"validate",
"(",
"bytes",
")",
";",
"return",
"serializer",
".",
"toString",
"(",
... | get a string representation of the bytes suitable for log messages | [
"get",
"a",
"string",
"representation",
"of",
"the",
"bytes",
"suitable",
"for",
"log",
"messages"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/AbstractType.java#L77-L83 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/marshal/AbstractType.java | AbstractType.isValueCompatibleWith | public boolean isValueCompatibleWith(AbstractType<?> otherType)
{
return isValueCompatibleWithInternal((otherType instanceof ReversedType) ? ((ReversedType) otherType).baseType : otherType);
} | java | public boolean isValueCompatibleWith(AbstractType<?> otherType)
{
return isValueCompatibleWithInternal((otherType instanceof ReversedType) ? ((ReversedType) otherType).baseType : otherType);
} | [
"public",
"boolean",
"isValueCompatibleWith",
"(",
"AbstractType",
"<",
"?",
">",
"otherType",
")",
"{",
"return",
"isValueCompatibleWithInternal",
"(",
"(",
"otherType",
"instanceof",
"ReversedType",
")",
"?",
"(",
"(",
"ReversedType",
")",
"otherType",
")",
".",... | Returns true if values of the other AbstractType can be read and "reasonably" interpreted by the this
AbstractType. Note that this is a weaker version of isCompatibleWith, as it does not require that both type
compare values the same way.
The restriction on the other type being "reasonably" interpreted is to prevent, ... | [
"Returns",
"true",
"if",
"values",
"of",
"the",
"other",
"AbstractType",
"can",
"be",
"read",
"and",
"reasonably",
"interpreted",
"by",
"the",
"this",
"AbstractType",
".",
"Note",
"that",
"this",
"is",
"a",
"weaker",
"version",
"of",
"isCompatibleWith",
"as",
... | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/AbstractType.java#L177-L180 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/marshal/AbstractType.java | AbstractType.compareCollectionMembers | public int compareCollectionMembers(ByteBuffer v1, ByteBuffer v2, ByteBuffer collectionName)
{
return compare(v1, v2);
} | java | public int compareCollectionMembers(ByteBuffer v1, ByteBuffer v2, ByteBuffer collectionName)
{
return compare(v1, v2);
} | [
"public",
"int",
"compareCollectionMembers",
"(",
"ByteBuffer",
"v1",
",",
"ByteBuffer",
"v2",
",",
"ByteBuffer",
"collectionName",
")",
"{",
"return",
"compare",
"(",
"v1",
",",
"v2",
")",
";",
"}"
] | An alternative comparison function used by CollectionsType in conjunction with CompositeType.
This comparator is only called to compare components of a CompositeType. It gets the value of the
previous component as argument (or null if it's the first component of the composite).
Unless you're doing something very simi... | [
"An",
"alternative",
"comparison",
"function",
"used",
"by",
"CollectionsType",
"in",
"conjunction",
"with",
"CompositeType",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/marshal/AbstractType.java#L208-L211 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.writeKey | private static void writeKey(PrintStream out, String value)
{
writeJSON(out, value);
out.print(": ");
} | java | private static void writeKey(PrintStream out, String value)
{
writeJSON(out, value);
out.print(": ");
} | [
"private",
"static",
"void",
"writeKey",
"(",
"PrintStream",
"out",
",",
"String",
"value",
")",
"{",
"writeJSON",
"(",
"out",
",",
"value",
")",
";",
"out",
".",
"print",
"(",
"\": \"",
")",
";",
"}"
] | JSON Hash Key serializer
@param out The output steam to write data
@param value value to set as a key | [
"JSON",
"Hash",
"Key",
"serializer"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L91-L95 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.serializeColumn | private static List<Object> serializeColumn(Cell cell, CFMetaData cfMetaData)
{
CellNameType comparator = cfMetaData.comparator;
ArrayList<Object> serializedColumn = new ArrayList<Object>();
serializedColumn.add(comparator.getString(cell.name()));
if (cell instanceof DeletedCell)
... | java | private static List<Object> serializeColumn(Cell cell, CFMetaData cfMetaData)
{
CellNameType comparator = cfMetaData.comparator;
ArrayList<Object> serializedColumn = new ArrayList<Object>();
serializedColumn.add(comparator.getString(cell.name()));
if (cell instanceof DeletedCell)
... | [
"private",
"static",
"List",
"<",
"Object",
">",
"serializeColumn",
"(",
"Cell",
"cell",
",",
"CFMetaData",
"cfMetaData",
")",
"{",
"CellNameType",
"comparator",
"=",
"cfMetaData",
".",
"comparator",
";",
"ArrayList",
"<",
"Object",
">",
"serializedColumn",
"=",... | Serialize a given cell to a List of Objects that jsonMapper knows how to turn into strings. Format is
human_readable_name, value, timestamp, [flag, [options]]
Value is normally the human readable value as rendered by the validator, but for deleted cells we
give the local deletion time instead.
Flag may be exactly o... | [
"Serialize",
"a",
"given",
"cell",
"to",
"a",
"List",
"of",
"Objects",
"that",
"jsonMapper",
"knows",
"how",
"to",
"turn",
"into",
"strings",
".",
"Format",
"is"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L134-L170 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.serializeRow | private static void serializeRow(SSTableIdentityIterator row, DecoratedKey key, PrintStream out)
{
serializeRow(row.getColumnFamily().deletionInfo(), row, row.getColumnFamily().metadata(), key, out);
} | java | private static void serializeRow(SSTableIdentityIterator row, DecoratedKey key, PrintStream out)
{
serializeRow(row.getColumnFamily().deletionInfo(), row, row.getColumnFamily().metadata(), key, out);
} | [
"private",
"static",
"void",
"serializeRow",
"(",
"SSTableIdentityIterator",
"row",
",",
"DecoratedKey",
"key",
",",
"PrintStream",
"out",
")",
"{",
"serializeRow",
"(",
"row",
".",
"getColumnFamily",
"(",
")",
".",
"deletionInfo",
"(",
")",
",",
"row",
",",
... | Get portion of the columns and serialize in loop while not more columns left in the row
@param row SSTableIdentityIterator row representation with Column Family
@param key Decorated Key for the required row
@param out output stream | [
"Get",
"portion",
"of",
"the",
"columns",
"and",
"serialize",
"in",
"loop",
"while",
"not",
"more",
"columns",
"left",
"in",
"the",
"row"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L179-L182 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.enumeratekeys | public static void enumeratekeys(Descriptor desc, PrintStream outs, CFMetaData metadata)
throws IOException
{
KeyIterator iter = new KeyIterator(desc);
try
{
DecoratedKey lastKey = null;
while (iter.hasNext())
{
DecoratedKey key = iter.... | java | public static void enumeratekeys(Descriptor desc, PrintStream outs, CFMetaData metadata)
throws IOException
{
KeyIterator iter = new KeyIterator(desc);
try
{
DecoratedKey lastKey = null;
while (iter.hasNext())
{
DecoratedKey key = iter.... | [
"public",
"static",
"void",
"enumeratekeys",
"(",
"Descriptor",
"desc",
",",
"PrintStream",
"outs",
",",
"CFMetaData",
"metadata",
")",
"throws",
"IOException",
"{",
"KeyIterator",
"iter",
"=",
"new",
"KeyIterator",
"(",
"desc",
")",
";",
"try",
"{",
"Decorate... | Enumerate row keys from an SSTableReader and write the result to a PrintStream.
@param desc the descriptor of the file to export the rows from
@param outs PrintStream to write the output to
@param metadata Metadata to print keys in a proper format
@throws IOException on failure to read/write input/output | [
"Enumerate",
"row",
"keys",
"from",
"an",
"SSTableReader",
"and",
"write",
"the",
"result",
"to",
"a",
"PrintStream",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L225-L249 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.export | public static void export(Descriptor desc, PrintStream outs, Collection<String> toExport, String[] excludes, CFMetaData metadata) throws IOException
{
SSTableReader sstable = SSTableReader.open(desc);
RandomAccessReader dfile = sstable.openDataReader();
try
{
IPartitioner... | java | public static void export(Descriptor desc, PrintStream outs, Collection<String> toExport, String[] excludes, CFMetaData metadata) throws IOException
{
SSTableReader sstable = SSTableReader.open(desc);
RandomAccessReader dfile = sstable.openDataReader();
try
{
IPartitioner... | [
"public",
"static",
"void",
"export",
"(",
"Descriptor",
"desc",
",",
"PrintStream",
"outs",
",",
"Collection",
"<",
"String",
">",
"toExport",
",",
"String",
"[",
"]",
"excludes",
",",
"CFMetaData",
"metadata",
")",
"throws",
"IOException",
"{",
"SSTableReade... | Export specific rows from an SSTable and write the resulting JSON to a PrintStream.
@param desc the descriptor of the sstable to read from
@param outs PrintStream to write the output to
@param toExport the keys corresponding to the rows to export
@param excludes keys to exclude from export
@param metadata Meta... | [
"Export",
"specific",
"rows",
"from",
"an",
"SSTable",
"and",
"write",
"the",
"resulting",
"JSON",
"to",
"a",
"PrintStream",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L261-L312 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.export | static void export(SSTableReader reader, PrintStream outs, String[] excludes, CFMetaData metadata) throws IOException
{
Set<String> excludeSet = new HashSet<String>();
if (excludes != null)
excludeSet = new HashSet<String>(Arrays.asList(excludes));
SSTableIdentityIterator row;
... | java | static void export(SSTableReader reader, PrintStream outs, String[] excludes, CFMetaData metadata) throws IOException
{
Set<String> excludeSet = new HashSet<String>();
if (excludes != null)
excludeSet = new HashSet<String>(Arrays.asList(excludes));
SSTableIdentityIterator row;
... | [
"static",
"void",
"export",
"(",
"SSTableReader",
"reader",
",",
"PrintStream",
"outs",
",",
"String",
"[",
"]",
"excludes",
",",
"CFMetaData",
"metadata",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"String",
">",
"excludeSet",
"=",
"new",
"HashSet",
"<"... | than once from within the same process. | [
"than",
"once",
"from",
"within",
"the",
"same",
"process",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L316-L356 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.export | public static void export(Descriptor desc, PrintStream outs, String[] excludes, CFMetaData metadata) throws IOException
{
export(SSTableReader.open(desc), outs, excludes, metadata);
} | java | public static void export(Descriptor desc, PrintStream outs, String[] excludes, CFMetaData metadata) throws IOException
{
export(SSTableReader.open(desc), outs, excludes, metadata);
} | [
"public",
"static",
"void",
"export",
"(",
"Descriptor",
"desc",
",",
"PrintStream",
"outs",
",",
"String",
"[",
"]",
"excludes",
",",
"CFMetaData",
"metadata",
")",
"throws",
"IOException",
"{",
"export",
"(",
"SSTableReader",
".",
"open",
"(",
"desc",
")",... | Export an SSTable and write the resulting JSON to a PrintStream.
@param desc the descriptor of the sstable to read from
@param outs PrintStream to write the output to
@param excludes keys to exclude from export
@param metadata Metadata to print keys in a proper format
@throws IOException on failure to read/wri... | [
"Export",
"an",
"SSTable",
"and",
"write",
"the",
"resulting",
"JSON",
"to",
"a",
"PrintStream",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L367-L370 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.export | public static void export(Descriptor desc, String[] excludes, CFMetaData metadata) throws IOException
{
export(desc, System.out, excludes, metadata);
} | java | public static void export(Descriptor desc, String[] excludes, CFMetaData metadata) throws IOException
{
export(desc, System.out, excludes, metadata);
} | [
"public",
"static",
"void",
"export",
"(",
"Descriptor",
"desc",
",",
"String",
"[",
"]",
"excludes",
",",
"CFMetaData",
"metadata",
")",
"throws",
"IOException",
"{",
"export",
"(",
"desc",
",",
"System",
".",
"out",
",",
"excludes",
",",
"metadata",
")",... | Export an SSTable and write the resulting JSON to standard out.
@param desc the descriptor of the sstable to read from
@param excludes keys to exclude from export
@param metadata Metadata to print keys in a proper format
@throws IOException on failure to read/write SSTable/standard out | [
"Export",
"an",
"SSTable",
"and",
"write",
"the",
"resulting",
"JSON",
"to",
"standard",
"out",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L380-L383 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/tools/SSTableExport.java | SSTableExport.main | public static void main(String[] args) throws ConfigurationException
{
String usage = String.format("Usage: %s <sstable> [-k key [-k key [...]] -x key [-x key [...]]]%n", SSTableExport.class.getName());
CommandLineParser parser = new PosixParser();
try
{
cmd = parser.par... | java | public static void main(String[] args) throws ConfigurationException
{
String usage = String.format("Usage: %s <sstable> [-k key [-k key [...]] -x key [-x key [...]]]%n", SSTableExport.class.getName());
CommandLineParser parser = new PosixParser();
try
{
cmd = parser.par... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"ConfigurationException",
"{",
"String",
"usage",
"=",
"String",
".",
"format",
"(",
"\"Usage: %s <sstable> [-k key [-k key [...]] -x key [-x key [...]]]%n\"",
",",
"SSTableExport",
".",... | Given arguments specifying an SSTable, and optionally an output file,
export the contents of the SSTable to JSON.
@param args command lines arguments
@throws IOException on failure to open/read/write files or output streams
@throws ConfigurationException on configuration failure (wrong params given) | [
"Given",
"arguments",
"specifying",
"an",
"SSTable",
"and",
"optionally",
"an",
"output",
"file",
"export",
"the",
"contents",
"of",
"the",
"SSTable",
"to",
"JSON",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/tools/SSTableExport.java#L393-L476 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/utils/SemanticVersion.java | SemanticVersion.findSupportingVersion | public SemanticVersion findSupportingVersion(SemanticVersion... versions)
{
for (SemanticVersion version : versions)
{
if (isSupportedBy(version))
return version;
}
return null;
} | java | public SemanticVersion findSupportingVersion(SemanticVersion... versions)
{
for (SemanticVersion version : versions)
{
if (isSupportedBy(version))
return version;
}
return null;
} | [
"public",
"SemanticVersion",
"findSupportingVersion",
"(",
"SemanticVersion",
"...",
"versions",
")",
"{",
"for",
"(",
"SemanticVersion",
"version",
":",
"versions",
")",
"{",
"if",
"(",
"isSupportedBy",
"(",
"version",
")",
")",
"return",
"version",
";",
"}",
... | Returns a version that is backward compatible with this version amongst a list
of provided version, or null if none can be found.
For instance:
"2.0.0".findSupportingVersion("2.0.0", "3.0.0") == "2.0.0"
"2.0.0".findSupportingVersion("2.1.3", "3.0.0") == "2.1.3"
"2.0.0".findSupportingVersion("3.0.0") == null
"2.0.3".fi... | [
"Returns",
"a",
"version",
"that",
"is",
"backward",
"compatible",
"with",
"this",
"version",
"amongst",
"a",
"list",
"of",
"provided",
"version",
"or",
"null",
"if",
"none",
"can",
"be",
"found",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/utils/SemanticVersion.java#L134-L142 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java | IndexSummaryManager.getCompactingAndNonCompactingSSTables | private Pair<List<SSTableReader>, Multimap<DataTracker, SSTableReader>> getCompactingAndNonCompactingSSTables()
{
List<SSTableReader> allCompacting = new ArrayList<>();
Multimap<DataTracker, SSTableReader> allNonCompacting = HashMultimap.create();
for (Keyspace ks : Keyspace.all())
{... | java | private Pair<List<SSTableReader>, Multimap<DataTracker, SSTableReader>> getCompactingAndNonCompactingSSTables()
{
List<SSTableReader> allCompacting = new ArrayList<>();
Multimap<DataTracker, SSTableReader> allNonCompacting = HashMultimap.create();
for (Keyspace ks : Keyspace.all())
{... | [
"private",
"Pair",
"<",
"List",
"<",
"SSTableReader",
">",
",",
"Multimap",
"<",
"DataTracker",
",",
"SSTableReader",
">",
">",
"getCompactingAndNonCompactingSSTables",
"(",
")",
"{",
"List",
"<",
"SSTableReader",
">",
"allCompacting",
"=",
"new",
"ArrayList",
"... | Returns a Pair of all compacting and non-compacting sstables. Non-compacting sstables will be marked as
compacting. | [
"Returns",
"a",
"Pair",
"of",
"all",
"compacting",
"and",
"non",
"-",
"compacting",
"sstables",
".",
"Non",
"-",
"compacting",
"sstables",
"will",
"be",
"marked",
"as",
"compacting",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java#L211-L231 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java | IndexSummaryManager.redistributeSummaries | @VisibleForTesting
public static List<SSTableReader> redistributeSummaries(List<SSTableReader> compacting, List<SSTableReader> nonCompacting, long memoryPoolBytes) throws IOException
{
long total = 0;
for (SSTableReader sstable : Iterables.concat(compacting, nonCompacting))
total += ... | java | @VisibleForTesting
public static List<SSTableReader> redistributeSummaries(List<SSTableReader> compacting, List<SSTableReader> nonCompacting, long memoryPoolBytes) throws IOException
{
long total = 0;
for (SSTableReader sstable : Iterables.concat(compacting, nonCompacting))
total += ... | [
"@",
"VisibleForTesting",
"public",
"static",
"List",
"<",
"SSTableReader",
">",
"redistributeSummaries",
"(",
"List",
"<",
"SSTableReader",
">",
"compacting",
",",
"List",
"<",
"SSTableReader",
">",
"nonCompacting",
",",
"long",
"memoryPoolBytes",
")",
"throws",
... | Attempts to fairly distribute a fixed pool of memory for index summaries across a set of SSTables based on
their recent read rates.
@param nonCompacting a list of sstables to share the memory pool across
@param memoryPoolBytes a size (in bytes) that the total index summary space usage should stay close to or
under, if ... | [
"Attempts",
"to",
"fairly",
"distribute",
"a",
"fixed",
"pool",
"of",
"memory",
"for",
"index",
"summaries",
"across",
"a",
"set",
"of",
"SSTables",
"based",
"on",
"their",
"recent",
"read",
"rates",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java#L255-L308 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql/Term.java | Term.getByteBuffer | public ByteBuffer getByteBuffer() throws InvalidRequestException
{
switch (type)
{
case STRING:
return AsciiType.instance.fromString(text);
case INTEGER:
return IntegerType.instance.fromString(text);
case UUID:
// we... | java | public ByteBuffer getByteBuffer() throws InvalidRequestException
{
switch (type)
{
case STRING:
return AsciiType.instance.fromString(text);
case INTEGER:
return IntegerType.instance.fromString(text);
case UUID:
// we... | [
"public",
"ByteBuffer",
"getByteBuffer",
"(",
")",
"throws",
"InvalidRequestException",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"STRING",
":",
"return",
"AsciiType",
".",
"instance",
".",
"fromString",
"(",
"text",
")",
";",
"case",
"INTEGER",
":",
"re... | Returns the typed value, serialized to a ByteBuffer.
@return a ByteBuffer of the value.
@throws InvalidRequestException if unable to coerce the string to its type. | [
"Returns",
"the",
"typed",
"value",
"serialized",
"to",
"a",
"ByteBuffer",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql/Term.java#L113-L131 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/concurrent/SEPWorker.java | SEPWorker.selfAssign | private boolean selfAssign()
{
// if we aren't permitted to assign in this state, fail
if (!get().canAssign(true))
return false;
for (SEPExecutor exec : pool.executors)
{
if (exec.takeWorkPermit(true))
{
Work work = new Work(exec);
... | java | private boolean selfAssign()
{
// if we aren't permitted to assign in this state, fail
if (!get().canAssign(true))
return false;
for (SEPExecutor exec : pool.executors)
{
if (exec.takeWorkPermit(true))
{
Work work = new Work(exec);
... | [
"private",
"boolean",
"selfAssign",
"(",
")",
"{",
"// if we aren't permitted to assign in this state, fail",
"if",
"(",
"!",
"get",
"(",
")",
".",
"canAssign",
"(",
"true",
")",
")",
"return",
"false",
";",
"for",
"(",
"SEPExecutor",
"exec",
":",
"pool",
".",... | try to assign ourselves an executor with work available | [
"try",
"to",
"assign",
"ourselves",
"an",
"executor",
"with",
"work",
"available"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/SEPWorker.java#L179-L200 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/concurrent/SEPWorker.java | SEPWorker.startSpinning | private void startSpinning()
{
assert get() == Work.WORKING;
pool.spinningCount.incrementAndGet();
set(Work.SPINNING);
} | java | private void startSpinning()
{
assert get() == Work.WORKING;
pool.spinningCount.incrementAndGet();
set(Work.SPINNING);
} | [
"private",
"void",
"startSpinning",
"(",
")",
"{",
"assert",
"get",
"(",
")",
"==",
"Work",
".",
"WORKING",
";",
"pool",
".",
"spinningCount",
".",
"incrementAndGet",
"(",
")",
";",
"set",
"(",
"Work",
".",
"SPINNING",
")",
";",
"}"
] | collection at the same time | [
"collection",
"at",
"the",
"same",
"time"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/SEPWorker.java#L205-L210 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/concurrent/SEPWorker.java | SEPWorker.doWaitSpin | private void doWaitSpin()
{
// pick a random sleep interval based on the number of threads spinning, so that
// we should always have a thread about to wake up, but most threads are sleeping
long sleep = 10000L * pool.spinningCount.get();
sleep = Math.min(1000000, sleep);
sle... | java | private void doWaitSpin()
{
// pick a random sleep interval based on the number of threads spinning, so that
// we should always have a thread about to wake up, but most threads are sleeping
long sleep = 10000L * pool.spinningCount.get();
sleep = Math.min(1000000, sleep);
sle... | [
"private",
"void",
"doWaitSpin",
"(",
")",
"{",
"// pick a random sleep interval based on the number of threads spinning, so that",
"// we should always have a thread about to wake up, but most threads are sleeping",
"long",
"sleep",
"=",
"10000L",
"*",
"pool",
".",
"spinningCount",
... | perform a sleep-spin, incrementing pool.stopCheck accordingly | [
"perform",
"a",
"sleep",
"-",
"spin",
"incrementing",
"pool",
".",
"stopCheck",
"accordingly"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/SEPWorker.java#L223-L253 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/concurrent/SEPWorker.java | SEPWorker.maybeStop | private void maybeStop(long stopCheck, long now)
{
long delta = now - stopCheck;
if (delta <= 0)
{
// if stopCheck has caught up with present, we've been spinning too much, so if we can atomically
// set it to the past again, we should stop a worker
if (po... | java | private void maybeStop(long stopCheck, long now)
{
long delta = now - stopCheck;
if (delta <= 0)
{
// if stopCheck has caught up with present, we've been spinning too much, so if we can atomically
// set it to the past again, we should stop a worker
if (po... | [
"private",
"void",
"maybeStop",
"(",
"long",
"stopCheck",
",",
"long",
"now",
")",
"{",
"long",
"delta",
"=",
"now",
"-",
"stopCheck",
";",
"if",
"(",
"delta",
"<=",
"0",
")",
"{",
"// if stopCheck has caught up with present, we've been spinning too much, so if we c... | realtime we have spun too much and deschedule; if we get too far behind realtime, we reset to our initial offset | [
"realtime",
"we",
"have",
"spun",
"too",
"much",
"and",
"deschedule",
";",
"if",
"we",
"get",
"too",
"far",
"behind",
"realtime",
"we",
"reset",
"to",
"our",
"initial",
"offset"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/concurrent/SEPWorker.java#L261-L290 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java | SecondaryIndexSearcher.postReconciliationProcessing | public List<Row> postReconciliationProcessing(List<IndexExpression> clause, List<Row> rows)
{
return rows;
} | java | public List<Row> postReconciliationProcessing(List<IndexExpression> clause, List<Row> rows)
{
return rows;
} | [
"public",
"List",
"<",
"Row",
">",
"postReconciliationProcessing",
"(",
"List",
"<",
"IndexExpression",
">",
"clause",
",",
"List",
"<",
"Row",
">",
"rows",
")",
"{",
"return",
"rows",
";",
"}"
] | Combines index query results from multiple nodes. This is done by the coordinator node after it has reconciled
the replica responses.
@param clause A list of {@link IndexExpression}s
@param rows The index query results to be combined
@return The combination of the index query results | [
"Combines",
"index",
"query",
"results",
"from",
"multiple",
"nodes",
".",
"This",
"is",
"done",
"by",
"the",
"coordinator",
"node",
"after",
"it",
"has",
"reconciled",
"the",
"replica",
"responses",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndexSearcher.java#L136-L139 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.isIndexBuilt | public boolean isIndexBuilt(ByteBuffer columnName)
{
return SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName(), getNameForSystemKeyspace(columnName));
} | java | public boolean isIndexBuilt(ByteBuffer columnName)
{
return SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName(), getNameForSystemKeyspace(columnName));
} | [
"public",
"boolean",
"isIndexBuilt",
"(",
"ByteBuffer",
"columnName",
")",
"{",
"return",
"SystemKeyspace",
".",
"isIndexBuilt",
"(",
"baseCfs",
".",
"keyspace",
".",
"getName",
"(",
")",
",",
"getNameForSystemKeyspace",
"(",
"columnName",
")",
")",
";",
"}"
] | Checks if the index for specified column is fully built
@param columnName the column
@return true if the index is fully built | [
"Checks",
"if",
"the",
"index",
"for",
"specified",
"column",
"is",
"fully",
"built"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L143-L146 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.buildIndexBlocking | protected void buildIndexBlocking()
{
logger.info(String.format("Submitting index build of %s for data in %s",
getIndexName(), StringUtils.join(baseCfs.getSSTables(), ", ")));
try (Refs<SSTableReader> sstables = baseCfs.selectAndReference(ColumnFamilyStore.CANONICAL_SSTABLES).refs)
... | java | protected void buildIndexBlocking()
{
logger.info(String.format("Submitting index build of %s for data in %s",
getIndexName(), StringUtils.join(baseCfs.getSSTables(), ", ")));
try (Refs<SSTableReader> sstables = baseCfs.selectAndReference(ColumnFamilyStore.CANONICAL_SSTABLES).refs)
... | [
"protected",
"void",
"buildIndexBlocking",
"(",
")",
"{",
"logger",
".",
"info",
"(",
"String",
".",
"format",
"(",
"\"Submitting index build of %s for data in %s\"",
",",
"getIndexName",
"(",
")",
",",
"StringUtils",
".",
"join",
"(",
"baseCfs",
".",
"getSSTables... | Builds the index using the data in the underlying CFS
Blocks till it's complete | [
"Builds",
"the",
"index",
"using",
"the",
"data",
"in",
"the",
"underlying",
"CFS",
"Blocks",
"till",
"it",
"s",
"complete"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L202-L218 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.buildIndexAsync | public Future<?> buildIndexAsync()
{
// if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done
boolean allAreBuilt = true;
for (ColumnDefinition cdef : columnDefs)
{
if (!SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName... | java | public Future<?> buildIndexAsync()
{
// if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done
boolean allAreBuilt = true;
for (ColumnDefinition cdef : columnDefs)
{
if (!SystemKeyspace.isIndexBuilt(baseCfs.keyspace.getName... | [
"public",
"Future",
"<",
"?",
">",
"buildIndexAsync",
"(",
")",
"{",
"// if we're just linking in the index to indexedColumns on an already-built index post-restart, we're done",
"boolean",
"allAreBuilt",
"=",
"true",
";",
"for",
"(",
"ColumnDefinition",
"cdef",
":",
"columnD... | Builds the index using the data in the underlying CF, non blocking
@return A future object which the caller can block on (optional) | [
"Builds",
"the",
"index",
"using",
"the",
"data",
"in",
"the",
"underlying",
"CF",
"non",
"blocking"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L227-L257 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.getIndexKeyFor | public DecoratedKey getIndexKeyFor(ByteBuffer value)
{
// FIXME: this imply one column definition per index
ByteBuffer name = columnDefs.iterator().next().name.bytes;
return new BufferDecoratedKey(new LocalToken(baseCfs.metadata.getColumnDefinition(name).type, value), value);
} | java | public DecoratedKey getIndexKeyFor(ByteBuffer value)
{
// FIXME: this imply one column definition per index
ByteBuffer name = columnDefs.iterator().next().name.bytes;
return new BufferDecoratedKey(new LocalToken(baseCfs.metadata.getColumnDefinition(name).type, value), value);
} | [
"public",
"DecoratedKey",
"getIndexKeyFor",
"(",
"ByteBuffer",
"value",
")",
"{",
"// FIXME: this imply one column definition per index",
"ByteBuffer",
"name",
"=",
"columnDefs",
".",
"iterator",
"(",
")",
".",
"next",
"(",
")",
".",
"name",
".",
"bytes",
";",
"re... | Returns the decoratedKey for a column value
@param value column value
@return decorated key | [
"Returns",
"the",
"decoratedKey",
"for",
"a",
"column",
"value"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L300-L305 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.createInstance | public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException
{
SecondaryIndex index;
switch (cdef.getIndexType())
{
case KEYS:
index = new KeysIndex();
break;
case COMPOSITES:
... | java | public static SecondaryIndex createInstance(ColumnFamilyStore baseCfs, ColumnDefinition cdef) throws ConfigurationException
{
SecondaryIndex index;
switch (cdef.getIndexType())
{
case KEYS:
index = new KeysIndex();
break;
case COMPOSITES:
... | [
"public",
"static",
"SecondaryIndex",
"createInstance",
"(",
"ColumnFamilyStore",
"baseCfs",
",",
"ColumnDefinition",
"cdef",
")",
"throws",
"ConfigurationException",
"{",
"SecondaryIndex",
"index",
";",
"switch",
"(",
"cdef",
".",
"getIndexType",
"(",
")",
")",
"{"... | This is the primary way to create a secondary index instance for a CF column.
It will validate the index_options before initializing.
@param baseCfs the source of data for the Index
@param cdef the meta information about this column (index_type, index_options, name, etc...)
@return The secondary index instance for th... | [
"This",
"is",
"the",
"primary",
"way",
"to",
"create",
"a",
"secondary",
"index",
"instance",
"for",
"a",
"CF",
"column",
".",
"It",
"will",
"validate",
"the",
"index_options",
"before",
"initializing",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L322-L356 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/db/index/SecondaryIndex.java | SecondaryIndex.getIndexComparator | public static CellNameType getIndexComparator(CFMetaData baseMetadata, ColumnDefinition cdef)
{
switch (cdef.getIndexType())
{
case KEYS:
return new SimpleDenseCellNameType(keyComparator);
case COMPOSITES:
return CompositesIndex.getIndexCompara... | java | public static CellNameType getIndexComparator(CFMetaData baseMetadata, ColumnDefinition cdef)
{
switch (cdef.getIndexType())
{
case KEYS:
return new SimpleDenseCellNameType(keyComparator);
case COMPOSITES:
return CompositesIndex.getIndexCompara... | [
"public",
"static",
"CellNameType",
"getIndexComparator",
"(",
"CFMetaData",
"baseMetadata",
",",
"ColumnDefinition",
"cdef",
")",
"{",
"switch",
"(",
"cdef",
".",
"getIndexType",
"(",
")",
")",
"{",
"case",
"KEYS",
":",
"return",
"new",
"SimpleDenseCellNameType",... | Returns the index comparator for index backed by CFS, or null.
Note: it would be cleaner to have this be a member method. However we need this when opening indexes
sstables, but by then the CFS won't be fully initiated, so the SecondaryIndex object won't be accessible. | [
"Returns",
"the",
"index",
"comparator",
"for",
"index",
"backed",
"by",
"CFS",
"or",
"null",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/db/index/SecondaryIndex.java#L368-L380 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/service/ActiveRepairService.java | ActiveRepairService.submitRepairSession | public RepairFuture submitRepairSession(UUID parentRepairSession, Range<Token> range, String keyspace, RepairParallelism parallelismDegree, Set<InetAddress> endpoints, String... cfnames)
{
if (cfnames.length == 0)
return null;
RepairSession session = new RepairSession(parentRepairSession... | java | public RepairFuture submitRepairSession(UUID parentRepairSession, Range<Token> range, String keyspace, RepairParallelism parallelismDegree, Set<InetAddress> endpoints, String... cfnames)
{
if (cfnames.length == 0)
return null;
RepairSession session = new RepairSession(parentRepairSession... | [
"public",
"RepairFuture",
"submitRepairSession",
"(",
"UUID",
"parentRepairSession",
",",
"Range",
"<",
"Token",
">",
"range",
",",
"String",
"keyspace",
",",
"RepairParallelism",
"parallelismDegree",
",",
"Set",
"<",
"InetAddress",
">",
"endpoints",
",",
"String",
... | Requests repairs for the given keyspace and column families.
@return Future for asynchronous call or null if there is no need to repair | [
"Requests",
"repairs",
"for",
"the",
"given",
"keyspace",
"and",
"column",
"families",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/ActiveRepairService.java#L123-L133 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/service/ActiveRepairService.java | ActiveRepairService.getNeighbors | public static Set<InetAddress> getNeighbors(String keyspaceName, Range<Token> toRepair, Collection<String> dataCenters, Collection<String> hosts)
{
StorageService ss = StorageService.instance;
Map<Range<Token>, List<InetAddress>> replicaSets = ss.getRangeToAddressMap(keyspaceName);
Range<Tok... | java | public static Set<InetAddress> getNeighbors(String keyspaceName, Range<Token> toRepair, Collection<String> dataCenters, Collection<String> hosts)
{
StorageService ss = StorageService.instance;
Map<Range<Token>, List<InetAddress>> replicaSets = ss.getRangeToAddressMap(keyspaceName);
Range<Tok... | [
"public",
"static",
"Set",
"<",
"InetAddress",
">",
"getNeighbors",
"(",
"String",
"keyspaceName",
",",
"Range",
"<",
"Token",
">",
"toRepair",
",",
"Collection",
"<",
"String",
">",
"dataCenters",
",",
"Collection",
"<",
"String",
">",
"hosts",
")",
"{",
... | Return all of the neighbors with whom we share the provided range.
@param keyspaceName keyspace to repair
@param toRepair token to repair
@param dataCenters the data centers to involve in the repair
@return neighbors with whom we share the provided range | [
"Return",
"all",
"of",
"the",
"neighbors",
"with",
"whom",
"we",
"share",
"the",
"provided",
"range",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/ActiveRepairService.java#L179-L248 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/transport/CBUtil.java | CBUtil.decodeString | private static String decodeString(ByteBuffer src) throws CharacterCodingException
{
// the decoder needs to be reset every time we use it, hence the copy per thread
CharsetDecoder theDecoder = decoder.get();
theDecoder.reset();
final CharBuffer dst = CharBuffer.allocate(
... | java | private static String decodeString(ByteBuffer src) throws CharacterCodingException
{
// the decoder needs to be reset every time we use it, hence the copy per thread
CharsetDecoder theDecoder = decoder.get();
theDecoder.reset();
final CharBuffer dst = CharBuffer.allocate(
... | [
"private",
"static",
"String",
"decodeString",
"(",
"ByteBuffer",
"src",
")",
"throws",
"CharacterCodingException",
"{",
"// the decoder needs to be reset every time we use it, hence the copy per thread",
"CharsetDecoder",
"theDecoder",
"=",
"decoder",
".",
"get",
"(",
")",
"... | is resolved in a release used by Cassandra. | [
"is",
"resolved",
"in",
"a",
"release",
"used",
"by",
"Cassandra",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/transport/CBUtil.java#L101-L119 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/service/CassandraDaemon.java | CassandraDaemon.activate | public void activate()
{
String pidFile = System.getProperty("cassandra-pidfile");
try
{
try
{
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
mbs.registerMBean(new StandardMBean(new NativeAccess(), NativeAccessMBean.clas... | java | public void activate()
{
String pidFile = System.getProperty("cassandra-pidfile");
try
{
try
{
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
mbs.registerMBean(new StandardMBean(new NativeAccess(), NativeAccessMBean.clas... | [
"public",
"void",
"activate",
"(",
")",
"{",
"String",
"pidFile",
"=",
"System",
".",
"getProperty",
"(",
"\"cassandra-pidfile\"",
")",
";",
"try",
"{",
"try",
"{",
"MBeanServer",
"mbs",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
... | A convenience method to initialize and start the daemon in one shot. | [
"A",
"convenience",
"method",
"to",
"initialize",
"and",
"start",
"the",
"daemon",
"in",
"one",
"shot",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/CassandraDaemon.java#L519-L561 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/cql3/KeyspaceElementName.java | KeyspaceElementName.toInternalName | protected static String toInternalName(String name, boolean keepCase)
{
return keepCase ? name : name.toLowerCase(Locale.US);
} | java | protected static String toInternalName(String name, boolean keepCase)
{
return keepCase ? name : name.toLowerCase(Locale.US);
} | [
"protected",
"static",
"String",
"toInternalName",
"(",
"String",
"name",
",",
"boolean",
"keepCase",
")",
"{",
"return",
"keepCase",
"?",
"name",
":",
"name",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
";",
"}"
] | Converts the specified name into the name used internally.
@param name the name
@param keepCase <code>true</code> if the case must be kept, <code>false</code> otherwise.
@return the name used internally. | [
"Converts",
"the",
"specified",
"name",
"into",
"the",
"name",
"used",
"internally",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/cql3/KeyspaceElementName.java#L64-L67 | train |
Stratio/stratio-cassandra | tools/stress/src/org/apache/cassandra/stress/util/DynamicList.java | DynamicList.append | public Node<E> append(E value, int maxSize)
{
Node<E> newTail = new Node<>(randomLevel(), value);
lock.writeLock().lock();
try
{
if (size >= maxSize)
return null;
size++;
Node<E> tail = head;
for (int i = maxHeight - 1... | java | public Node<E> append(E value, int maxSize)
{
Node<E> newTail = new Node<>(randomLevel(), value);
lock.writeLock().lock();
try
{
if (size >= maxSize)
return null;
size++;
Node<E> tail = head;
for (int i = maxHeight - 1... | [
"public",
"Node",
"<",
"E",
">",
"append",
"(",
"E",
"value",
",",
"int",
"maxSize",
")",
"{",
"Node",
"<",
"E",
">",
"newTail",
"=",
"new",
"Node",
"<>",
"(",
"randomLevel",
"(",
")",
",",
"value",
")",
";",
"lock",
".",
"writeLock",
"(",
")",
... | regardless of its future position in the list from other modifications | [
"regardless",
"of",
"its",
"future",
"position",
"in",
"the",
"list",
"from",
"other",
"modifications"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/DynamicList.java#L115-L150 | train |
Stratio/stratio-cassandra | tools/stress/src/org/apache/cassandra/stress/util/DynamicList.java | DynamicList.remove | public void remove(Node<E> node)
{
lock.writeLock().lock();
assert node.value != null;
node.value = null;
try
{
size--;
// go up through each level in the skip list, unlinking this node; this entails
// simply linking each neighbour to eac... | java | public void remove(Node<E> node)
{
lock.writeLock().lock();
assert node.value != null;
node.value = null;
try
{
size--;
// go up through each level in the skip list, unlinking this node; this entails
// simply linking each neighbour to eac... | [
"public",
"void",
"remove",
"(",
"Node",
"<",
"E",
">",
"node",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"assert",
"node",
".",
"value",
"!=",
"null",
";",
"node",
".",
"value",
"=",
"null",
";",
"try",
"{",
"si... | remove the provided node and its associated value from the list | [
"remove",
"the",
"provided",
"node",
"and",
"its",
"associated",
"value",
"from",
"the",
"list"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/DynamicList.java#L153-L193 | train |
Stratio/stratio-cassandra | tools/stress/src/org/apache/cassandra/stress/util/DynamicList.java | DynamicList.get | public E get(int index)
{
lock.readLock().lock();
try
{
if (index >= size)
return null;
index++;
int c = 0;
Node<E> finger = head;
for (int i = maxHeight - 1 ; i >= 0 ; i--)
{
while (c + ... | java | public E get(int index)
{
lock.readLock().lock();
try
{
if (index >= size)
return null;
index++;
int c = 0;
Node<E> finger = head;
for (int i = maxHeight - 1 ; i >= 0 ; i--)
{
while (c + ... | [
"public",
"E",
"get",
"(",
"int",
"index",
")",
"{",
"lock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"index",
">=",
"size",
")",
"return",
"null",
";",
"index",
"++",
";",
"int",
"c",
"=",
"0",
";",
"Node... | retrieve the item at the provided index, or return null if the index is past the end of the list | [
"retrieve",
"the",
"item",
"at",
"the",
"provided",
"index",
"or",
"return",
"null",
"if",
"the",
"index",
"is",
"past",
"the",
"end",
"of",
"the",
"list"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/DynamicList.java#L196-L223 | train |
Stratio/stratio-cassandra | tools/stress/src/org/apache/cassandra/stress/util/DynamicList.java | DynamicList.isWellFormed | private boolean isWellFormed()
{
for (int i = 0 ; i < maxHeight ; i++)
{
int c = 0;
for (Node node = head ; node != null ; node = node.next(i))
{
if (node.prev(i) != null && node.prev(i).next(i) != node)
return false;
... | java | private boolean isWellFormed()
{
for (int i = 0 ; i < maxHeight ; i++)
{
int c = 0;
for (Node node = head ; node != null ; node = node.next(i))
{
if (node.prev(i) != null && node.prev(i).next(i) != node)
return false;
... | [
"private",
"boolean",
"isWellFormed",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"maxHeight",
";",
"i",
"++",
")",
"{",
"int",
"c",
"=",
"0",
";",
"for",
"(",
"Node",
"node",
"=",
"head",
";",
"node",
"!=",
"null",
";",
"... | don't create a separate unit test - tools tree doesn't currently warrant them | [
"don",
"t",
"create",
"a",
"separate",
"unit",
"test",
"-",
"tools",
"tree",
"doesn",
"t",
"currently",
"warrant",
"them"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/tools/stress/src/org/apache/cassandra/stress/util/DynamicList.java#L228-L251 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/IndexSummary.java | IndexSummary.binarySearch | public int binarySearch(RowPosition key)
{
int low = 0, mid = offsetCount, high = mid - 1, result = -1;
while (low <= high)
{
mid = (low + high) >> 1;
result = -DecoratedKey.compareTo(partitioner, ByteBuffer.wrap(getKey(mid)), key);
if (result > 0)
... | java | public int binarySearch(RowPosition key)
{
int low = 0, mid = offsetCount, high = mid - 1, result = -1;
while (low <= high)
{
mid = (low + high) >> 1;
result = -DecoratedKey.compareTo(partitioner, ByteBuffer.wrap(getKey(mid)), key);
if (result > 0)
... | [
"public",
"int",
"binarySearch",
"(",
"RowPosition",
"key",
")",
"{",
"int",
"low",
"=",
"0",
",",
"mid",
"=",
"offsetCount",
",",
"high",
"=",
"mid",
"-",
"1",
",",
"result",
"=",
"-",
"1",
";",
"while",
"(",
"low",
"<=",
"high",
")",
"{",
"mid"... | Harmony's Collections implementation | [
"Harmony",
"s",
"Collections",
"implementation"
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/IndexSummary.java#L107-L129 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/triggers/TriggerExecutor.java | TriggerExecutor.reloadClasses | public void reloadClasses()
{
File triggerDirectory = FBUtilities.cassandraTriggerDir();
if (triggerDirectory == null)
return;
customClassLoader = new CustomClassLoader(parent, triggerDirectory);
cachedTriggers.clear();
} | java | public void reloadClasses()
{
File triggerDirectory = FBUtilities.cassandraTriggerDir();
if (triggerDirectory == null)
return;
customClassLoader = new CustomClassLoader(parent, triggerDirectory);
cachedTriggers.clear();
} | [
"public",
"void",
"reloadClasses",
"(",
")",
"{",
"File",
"triggerDirectory",
"=",
"FBUtilities",
".",
"cassandraTriggerDir",
"(",
")",
";",
"if",
"(",
"triggerDirectory",
"==",
"null",
")",
"return",
";",
"customClassLoader",
"=",
"new",
"CustomClassLoader",
"(... | Reload the triggers which is already loaded, Invoking this will update
the class loader so new jars can be loaded. | [
"Reload",
"the",
"triggers",
"which",
"is",
"already",
"loaded",
"Invoking",
"this",
"will",
"update",
"the",
"class",
"loader",
"so",
"new",
"jars",
"can",
"be",
"loaded",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/triggers/TriggerExecutor.java#L54-L61 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/triggers/TriggerExecutor.java | TriggerExecutor.executeInternal | private List<Mutation> executeInternal(ByteBuffer key, ColumnFamily columnFamily)
{
Map<String, TriggerDefinition> triggers = columnFamily.metadata().getTriggers();
if (triggers.isEmpty())
return null;
List<Mutation> tmutations = Lists.newLinkedList();
Thread.currentThrea... | java | private List<Mutation> executeInternal(ByteBuffer key, ColumnFamily columnFamily)
{
Map<String, TriggerDefinition> triggers = columnFamily.metadata().getTriggers();
if (triggers.isEmpty())
return null;
List<Mutation> tmutations = Lists.newLinkedList();
Thread.currentThrea... | [
"private",
"List",
"<",
"Mutation",
">",
"executeInternal",
"(",
"ByteBuffer",
"key",
",",
"ColumnFamily",
"columnFamily",
")",
"{",
"Map",
"<",
"String",
",",
"TriggerDefinition",
">",
"triggers",
"=",
"columnFamily",
".",
"metadata",
"(",
")",
".",
"getTrigg... | Switch class loader before using the triggers for the column family, if
not loaded them with the custom class loader. | [
"Switch",
"class",
"loader",
"before",
"using",
"the",
"triggers",
"for",
"the",
"column",
"family",
"if",
"not",
"loaded",
"them",
"with",
"the",
"custom",
"class",
"loader",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/triggers/TriggerExecutor.java#L174-L205 | train |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/index/schema/analysis/SnowballAnalyzerBuilder.java | SnowballAnalyzerBuilder.getDefaultStopwords | private static CharArraySet getDefaultStopwords(String language) {
switch (language) {
case "English":
return EnglishAnalyzer.getDefaultStopSet();
case "French":
return FrenchAnalyzer.getDefaultStopSet();
case "Spanish":
return ... | java | private static CharArraySet getDefaultStopwords(String language) {
switch (language) {
case "English":
return EnglishAnalyzer.getDefaultStopSet();
case "French":
return FrenchAnalyzer.getDefaultStopSet();
case "Spanish":
return ... | [
"private",
"static",
"CharArraySet",
"getDefaultStopwords",
"(",
"String",
"language",
")",
"{",
"switch",
"(",
"language",
")",
"{",
"case",
"\"English\"",
":",
"return",
"EnglishAnalyzer",
".",
"getDefaultStopSet",
"(",
")",
";",
"case",
"\"French\"",
":",
"re... | Returns the default stopwords set used by Lucene language analyzer for the specified language.
@param language The language for which the stopwords are. The supported languages are English, French, Spanish,
Portuguese, Italian, Romanian, German, Dutch, Swedish, Norwegian, Danish, Russian, Finnish,
Irish, Hungarian, Tu... | [
"Returns",
"the",
"default",
"stopwords",
"set",
"used",
"by",
"Lucene",
"language",
"analyzer",
"for",
"the",
"specified",
"language",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/index/schema/analysis/SnowballAnalyzerBuilder.java#L140-L183 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java | CqlConfigHelper.setInputColumns | public static void setInputColumns(Configuration conf, String columns)
{
if (columns == null || columns.isEmpty())
return;
conf.set(INPUT_CQL_COLUMNS_CONFIG, columns);
} | java | public static void setInputColumns(Configuration conf, String columns)
{
if (columns == null || columns.isEmpty())
return;
conf.set(INPUT_CQL_COLUMNS_CONFIG, columns);
} | [
"public",
"static",
"void",
"setInputColumns",
"(",
"Configuration",
"conf",
",",
"String",
"columns",
")",
"{",
"if",
"(",
"columns",
"==",
"null",
"||",
"columns",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"conf",
".",
"set",
"(",
"INPUT_CQL_COLUMNS_... | Set the CQL columns for the input of this job.
@param conf Job configuration you are about to run
@param columns | [
"Set",
"the",
"CQL",
"columns",
"for",
"the",
"input",
"of",
"this",
"job",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java#L94-L100 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java | CqlConfigHelper.setInputCQLPageRowSize | public static void setInputCQLPageRowSize(Configuration conf, String cqlPageRowSize)
{
if (cqlPageRowSize == null)
{
throw new UnsupportedOperationException("cql page row size may not be null");
}
conf.set(INPUT_CQL_PAGE_ROW_SIZE_CONFIG, cqlPageRowSize);
} | java | public static void setInputCQLPageRowSize(Configuration conf, String cqlPageRowSize)
{
if (cqlPageRowSize == null)
{
throw new UnsupportedOperationException("cql page row size may not be null");
}
conf.set(INPUT_CQL_PAGE_ROW_SIZE_CONFIG, cqlPageRowSize);
} | [
"public",
"static",
"void",
"setInputCQLPageRowSize",
"(",
"Configuration",
"conf",
",",
"String",
"cqlPageRowSize",
")",
"{",
"if",
"(",
"cqlPageRowSize",
"==",
"null",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"cql page row size may not be null... | Set the CQL query Limit for the input of this job.
@param conf Job configuration you are about to run
@param cqlPageRowSize | [
"Set",
"the",
"CQL",
"query",
"Limit",
"for",
"the",
"input",
"of",
"this",
"job",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java#L108-L116 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java | CqlConfigHelper.setInputWhereClauses | public static void setInputWhereClauses(Configuration conf, String clauses)
{
if (clauses == null || clauses.isEmpty())
return;
conf.set(INPUT_CQL_WHERE_CLAUSE_CONFIG, clauses);
} | java | public static void setInputWhereClauses(Configuration conf, String clauses)
{
if (clauses == null || clauses.isEmpty())
return;
conf.set(INPUT_CQL_WHERE_CLAUSE_CONFIG, clauses);
} | [
"public",
"static",
"void",
"setInputWhereClauses",
"(",
"Configuration",
"conf",
",",
"String",
"clauses",
")",
"{",
"if",
"(",
"clauses",
"==",
"null",
"||",
"clauses",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"conf",
".",
"set",
"(",
"INPUT_CQL_WHE... | Set the CQL user defined where clauses for the input of this job.
@param conf Job configuration you are about to run
@param clauses | [
"Set",
"the",
"CQL",
"user",
"defined",
"where",
"clauses",
"for",
"the",
"input",
"of",
"this",
"job",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java#L124-L130 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java | CqlConfigHelper.setOutputCql | public static void setOutputCql(Configuration conf, String cql)
{
if (cql == null || cql.isEmpty())
return;
conf.set(OUTPUT_CQL, cql);
} | java | public static void setOutputCql(Configuration conf, String cql)
{
if (cql == null || cql.isEmpty())
return;
conf.set(OUTPUT_CQL, cql);
} | [
"public",
"static",
"void",
"setOutputCql",
"(",
"Configuration",
"conf",
",",
"String",
"cql",
")",
"{",
"if",
"(",
"cql",
"==",
"null",
"||",
"cql",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"conf",
".",
"set",
"(",
"OUTPUT_CQL",
",",
"cql",
")... | Set the CQL prepared statement for the output of this job.
@param conf Job configuration you are about to run
@param cql | [
"Set",
"the",
"CQL",
"prepared",
"statement",
"for",
"the",
"output",
"of",
"this",
"job",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/hadoop/cql3/CqlConfigHelper.java#L138-L144 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/service/ClientState.java | ClientState.getTimestamp | public long getTimestamp()
{
while (true)
{
long current = System.currentTimeMillis() * 1000;
long last = lastTimestampMicros.get();
long tstamp = last >= current ? last + 1 : current;
if (lastTimestampMicros.compareAndSet(last, tstamp))
... | java | public long getTimestamp()
{
while (true)
{
long current = System.currentTimeMillis() * 1000;
long last = lastTimestampMicros.get();
long tstamp = last >= current ? last + 1 : current;
if (lastTimestampMicros.compareAndSet(last, tstamp))
... | [
"public",
"long",
"getTimestamp",
"(",
")",
"{",
"while",
"(",
"true",
")",
"{",
"long",
"current",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"*",
"1000",
";",
"long",
"last",
"=",
"lastTimestampMicros",
".",
"get",
"(",
")",
";",
"long",
"tst... | This clock guarantees that updates for the same ClientState will be ordered
in the sequence seen, even if multiple updates happen in the same millisecond. | [
"This",
"clock",
"guarantees",
"that",
"updates",
"for",
"the",
"same",
"ClientState",
"will",
"be",
"ordered",
"in",
"the",
"sequence",
"seen",
"even",
"if",
"multiple",
"updates",
"happen",
"in",
"the",
"same",
"millisecond",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/ClientState.java#L141-L151 | train |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/service/ClientState.java | ClientState.login | public void login(AuthenticatedUser user) throws AuthenticationException
{
if (!user.isAnonymous() && !Auth.isExistingUser(user.getName()))
throw new AuthenticationException(String.format("User %s doesn't exist - create it with CREATE USER query first",
... | java | public void login(AuthenticatedUser user) throws AuthenticationException
{
if (!user.isAnonymous() && !Auth.isExistingUser(user.getName()))
throw new AuthenticationException(String.format("User %s doesn't exist - create it with CREATE USER query first",
... | [
"public",
"void",
"login",
"(",
"AuthenticatedUser",
"user",
")",
"throws",
"AuthenticationException",
"{",
"if",
"(",
"!",
"user",
".",
"isAnonymous",
"(",
")",
"&&",
"!",
"Auth",
".",
"isExistingUser",
"(",
"user",
".",
"getName",
"(",
")",
")",
")",
"... | Attempts to login the given user. | [
"Attempts",
"to",
"login",
"the",
"given",
"user",
"."
] | f6416b43ad5309083349ad56266450fa8c6a2106 | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/service/ClientState.java#L203-L209 | train |
KostyaSha/yet-another-docker-plugin | yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/DockerProvisioningStrategy.java | DockerProvisioningStrategy.notAllowedStrategy | @VisibleForTesting
protected static boolean notAllowedStrategy(DockerSlaveTemplate template) {
if (isNull(template)) {
LOG.debug("Skipping DockerProvisioningStrategy because: template is null");
return true;
}
final RetentionStrategy retentionStrategy = template.getR... | java | @VisibleForTesting
protected static boolean notAllowedStrategy(DockerSlaveTemplate template) {
if (isNull(template)) {
LOG.debug("Skipping DockerProvisioningStrategy because: template is null");
return true;
}
final RetentionStrategy retentionStrategy = template.getR... | [
"@",
"VisibleForTesting",
"protected",
"static",
"boolean",
"notAllowedStrategy",
"(",
"DockerSlaveTemplate",
"template",
")",
"{",
"if",
"(",
"isNull",
"(",
"template",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Skipping DockerProvisioningStrategy because: template is... | Exclude unknown mix of configuration. | [
"Exclude",
"unknown",
"mix",
"of",
"configuration",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/DockerProvisioningStrategy.java#L119-L150 | train |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java | DockerRule.pullImage | public void pullImage(DockerImagePullStrategy pullStrategy, String imageName) throws InterruptedException {
LOG.info("Pulling image {} with {} strategy...", imageName, pullStrategy);
final List<Image> images = getDockerCli().listImagesCmd().withShowAll(true).exec();
NameParser.ReposTag repostag... | java | public void pullImage(DockerImagePullStrategy pullStrategy, String imageName) throws InterruptedException {
LOG.info("Pulling image {} with {} strategy...", imageName, pullStrategy);
final List<Image> images = getDockerCli().listImagesCmd().withShowAll(true).exec();
NameParser.ReposTag repostag... | [
"public",
"void",
"pullImage",
"(",
"DockerImagePullStrategy",
"pullStrategy",
",",
"String",
"imageName",
")",
"throws",
"InterruptedException",
"{",
"LOG",
".",
"info",
"(",
"\"Pulling image {} with {} strategy...\"",
",",
"imageName",
",",
"pullStrategy",
")",
";",
... | Pull docker image on this docker host. | [
"Pull",
"docker",
"image",
"on",
"this",
"docker",
"host",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java#L144-L173 | train |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java | DockerRule.buildImage | public String buildImage(Map<String, File> plugins) throws IOException, InterruptedException {
LOG.debug("Building image for {}", plugins);
// final File tempDirectory = TempFileHelper.createTempDirectory("build-image", targetDir().toPath());
final File buildDir = new File(targetDir().getAbsolute... | java | public String buildImage(Map<String, File> plugins) throws IOException, InterruptedException {
LOG.debug("Building image for {}", plugins);
// final File tempDirectory = TempFileHelper.createTempDirectory("build-image", targetDir().toPath());
final File buildDir = new File(targetDir().getAbsolute... | [
"public",
"String",
"buildImage",
"(",
"Map",
"<",
"String",
",",
"File",
">",
"plugins",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"LOG",
".",
"debug",
"(",
"\"Building image for {}\"",
",",
"plugins",
")",
";",
"// final File tempDir... | Build docker image containing specified plugins. | [
"Build",
"docker",
"image",
"containing",
"specified",
"plugins",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java#L377-L427 | train |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java | DockerRule.runFreshJenkinsContainer | public String runFreshJenkinsContainer(DockerImagePullStrategy pullStrategy, boolean forceRefresh)
throws IOException, SettingsBuildingException, InterruptedException {
LOG.debug("Entering run fresh jenkins container.");
pullImage(pullStrategy, JENKINS_DEFAULT.getDockerImageName());
... | java | public String runFreshJenkinsContainer(DockerImagePullStrategy pullStrategy, boolean forceRefresh)
throws IOException, SettingsBuildingException, InterruptedException {
LOG.debug("Entering run fresh jenkins container.");
pullImage(pullStrategy, JENKINS_DEFAULT.getDockerImageName());
... | [
"public",
"String",
"runFreshJenkinsContainer",
"(",
"DockerImagePullStrategy",
"pullStrategy",
",",
"boolean",
"forceRefresh",
")",
"throws",
"IOException",
",",
"SettingsBuildingException",
",",
"InterruptedException",
"{",
"LOG",
".",
"debug",
"(",
"\"Entering run fresh ... | Run, record and remove after test container with jenkins.
@param forceRefresh enforce data container and data image refresh | [
"Run",
"record",
"and",
"remove",
"after",
"test",
"container",
"with",
"jenkins",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java#L444-L488 | train |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java | DockerRule.generateDockerfileFor | public String generateDockerfileFor(Map<String, File> plugins) throws IOException {
StringBuilder builder = new StringBuilder();
builder.append("FROM scratch").append(NL)
.append("MAINTAINER Kanstantsin Shautsou <kanstantsin.sha@gmail.com>").append(NL)
.append("COPY ./ /"... | java | public String generateDockerfileFor(Map<String, File> plugins) throws IOException {
StringBuilder builder = new StringBuilder();
builder.append("FROM scratch").append(NL)
.append("MAINTAINER Kanstantsin Shautsou <kanstantsin.sha@gmail.com>").append(NL)
.append("COPY ./ /"... | [
"public",
"String",
"generateDockerfileFor",
"(",
"Map",
"<",
"String",
",",
"File",
">",
"plugins",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"FROM scratch\"",
"... | 'Dockerfile' as String based on sratch for placing plugins. | [
"Dockerfile",
"as",
"String",
"based",
"on",
"sratch",
"for",
"placing",
"plugins",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java#L502-L516 | train |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java | DockerRule.createCliWithWait | private DockerCLI createCliWithWait(URL url, int port) throws InterruptedException, IOException {
DockerCLI tempCli = null;
boolean connected = false;
int i = 0;
while (i <= 10 && !connected) {
i++;
try {
final CLIConnectionFactory factory = new CL... | java | private DockerCLI createCliWithWait(URL url, int port) throws InterruptedException, IOException {
DockerCLI tempCli = null;
boolean connected = false;
int i = 0;
while (i <= 10 && !connected) {
i++;
try {
final CLIConnectionFactory factory = new CL... | [
"private",
"DockerCLI",
"createCliWithWait",
"(",
"URL",
"url",
",",
"int",
"port",
")",
"throws",
"InterruptedException",
",",
"IOException",
"{",
"DockerCLI",
"tempCli",
"=",
"null",
";",
"boolean",
"connected",
"=",
"false",
";",
"int",
"i",
"=",
"0",
";"... | Create DockerCLI connection against specified jnlpSlaveAgent port | [
"Create",
"DockerCLI",
"connection",
"against",
"specified",
"jnlpSlaveAgent",
"port"
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-its/src/main/java/com/github/kostyasha/it/rule/DockerRule.java#L568-L601 | train |
KostyaSha/yet-another-docker-plugin | yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/strategy/DockerCloudRetentionStrategy.java | DockerCloudRetentionStrategy.check | @Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer c) {
final AbstractCloudSlave computerNode = c.getNode();
if (c.isIdle() && computerNode != null) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
... | java | @Override
@GuardedBy("hudson.model.Queue.lock")
public long check(final AbstractCloudComputer c) {
final AbstractCloudSlave computerNode = c.getNode();
if (c.isIdle() && computerNode != null) {
final long idleMilliseconds = System.currentTimeMillis() - c.getIdleStartMilliseconds();
... | [
"@",
"Override",
"@",
"GuardedBy",
"(",
"\"hudson.model.Queue.lock\"",
")",
"public",
"long",
"check",
"(",
"final",
"AbstractCloudComputer",
"c",
")",
"{",
"final",
"AbstractCloudSlave",
"computerNode",
"=",
"c",
".",
"getNode",
"(",
")",
";",
"if",
"(",
"c",... | While x-stream serialisation buggy, copy implementation. | [
"While",
"x",
"-",
"stream",
"serialisation",
"buggy",
"copy",
"implementation",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/strategy/DockerCloudRetentionStrategy.java#L38-L54 | train |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/main/java/com/github/kostyasha/it/utils/JenkinsRuleHelpers.java | JenkinsRuleHelpers.isSomethingHappening | public static boolean isSomethingHappening(Jenkins jenkins) {
if (!jenkins.getQueue().isEmpty())
return true;
for (Computer n : jenkins.getComputers())
if (!n.isIdle())
return true;
return false;
} | java | public static boolean isSomethingHappening(Jenkins jenkins) {
if (!jenkins.getQueue().isEmpty())
return true;
for (Computer n : jenkins.getComputers())
if (!n.isIdle())
return true;
return false;
} | [
"public",
"static",
"boolean",
"isSomethingHappening",
"(",
"Jenkins",
"jenkins",
")",
"{",
"if",
"(",
"!",
"jenkins",
".",
"getQueue",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"return",
"true",
";",
"for",
"(",
"Computer",
"n",
":",
"jenkins",
".",
"g... | Returns true if Hudson is building something or going to build something. | [
"Returns",
"true",
"if",
"Hudson",
"is",
"building",
"something",
"or",
"going",
"to",
"build",
"something",
"."
] | 40b12e39ff94c3834cff7e028c3dd01c88e87d77 | https://github.com/KostyaSha/yet-another-docker-plugin/blob/40b12e39ff94c3834cff7e028c3dd01c88e87d77/yet-another-docker-its/src/main/java/com/github/kostyasha/it/utils/JenkinsRuleHelpers.java#L38-L45 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.