id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
55,100 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/IntersectionImplR.java | IntersectionImplR.checkMaxLgArrLongs | static final int checkMaxLgArrLongs(final Memory dstMem) {
final int preBytes = CONST_PREAMBLE_LONGS << 3;
final long cap = dstMem.getCapacity();
final int maxLgArrLongs =
Integer.numberOfTrailingZeros(floorPowerOf2((int)(cap - preBytes)) >>> 3);
if (maxLgArrLongs < MIN_LG_ARR_LONGS) {
thr... | java | static final int checkMaxLgArrLongs(final Memory dstMem) {
final int preBytes = CONST_PREAMBLE_LONGS << 3;
final long cap = dstMem.getCapacity();
final int maxLgArrLongs =
Integer.numberOfTrailingZeros(floorPowerOf2((int)(cap - preBytes)) >>> 3);
if (maxLgArrLongs < MIN_LG_ARR_LONGS) {
thr... | [
"static",
"final",
"int",
"checkMaxLgArrLongs",
"(",
"final",
"Memory",
"dstMem",
")",
"{",
"final",
"int",
"preBytes",
"=",
"CONST_PREAMBLE_LONGS",
"<<",
"3",
";",
"final",
"long",
"cap",
"=",
"dstMem",
".",
"getCapacity",
"(",
")",
";",
"final",
"int",
"... | Returns the correct maximum lgArrLongs given the capacity of the Memory. Checks that the
capacity is large enough for the minimum sized hash table.
@param dstMem the given Memory
@return the correct maximum lgArrLongs given the capacity of the Memory | [
"Returns",
"the",
"correct",
"maximum",
"lgArrLongs",
"given",
"the",
"capacity",
"of",
"the",
"Memory",
".",
"Checks",
"that",
"the",
"capacity",
"is",
"large",
"enough",
"for",
"the",
"minimum",
"sized",
"hash",
"table",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/IntersectionImplR.java#L277-L287 |
55,101 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java | IntersectionImpl.initNewHeapInstance | static IntersectionImpl initNewHeapInstance(final long seed) {
final IntersectionImpl impl = new IntersectionImpl(null, seed, false);
impl.lgArrLongs_ = 0;
impl.curCount_ = -1; //Universal Set is true
impl.thetaLong_ = Long.MAX_VALUE;
impl.empty_ = false; //A virgin intersection represents the Uni... | java | static IntersectionImpl initNewHeapInstance(final long seed) {
final IntersectionImpl impl = new IntersectionImpl(null, seed, false);
impl.lgArrLongs_ = 0;
impl.curCount_ = -1; //Universal Set is true
impl.thetaLong_ = Long.MAX_VALUE;
impl.empty_ = false; //A virgin intersection represents the Uni... | [
"static",
"IntersectionImpl",
"initNewHeapInstance",
"(",
"final",
"long",
"seed",
")",
"{",
"final",
"IntersectionImpl",
"impl",
"=",
"new",
"IntersectionImpl",
"(",
"null",
",",
"seed",
",",
"false",
")",
";",
"impl",
".",
"lgArrLongs_",
"=",
"0",
";",
"im... | Construct a new Intersection target on the java heap.
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See Seed</a>
@return a new IntersectionImpl on the Java heap | [
"Construct",
"a",
"new",
"Intersection",
"target",
"on",
"the",
"java",
"heap",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java#L54-L62 |
55,102 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java | IntersectionImpl.initNewDirectInstance | static IntersectionImpl initNewDirectInstance(final long seed, final WritableMemory dstMem) {
final IntersectionImpl impl = new IntersectionImpl(dstMem, seed, true);
//Load Preamble
insertPreLongs(dstMem, CONST_PREAMBLE_LONGS); //RF not used = 0
insertSerVer(dstMem, SER_VER);
insertFamilyID(dstMem,... | java | static IntersectionImpl initNewDirectInstance(final long seed, final WritableMemory dstMem) {
final IntersectionImpl impl = new IntersectionImpl(dstMem, seed, true);
//Load Preamble
insertPreLongs(dstMem, CONST_PREAMBLE_LONGS); //RF not used = 0
insertSerVer(dstMem, SER_VER);
insertFamilyID(dstMem,... | [
"static",
"IntersectionImpl",
"initNewDirectInstance",
"(",
"final",
"long",
"seed",
",",
"final",
"WritableMemory",
"dstMem",
")",
"{",
"final",
"IntersectionImpl",
"impl",
"=",
"new",
"IntersectionImpl",
"(",
"dstMem",
",",
"seed",
",",
"true",
")",
";",
"//Lo... | Construct a new Intersection target direct to the given destination Memory.
Called by SetOperation.Builder.
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See Seed</a>
@param dstMem destination Memory.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@return a new IntersectionImpl tha... | [
"Construct",
"a",
"new",
"Intersection",
"target",
"direct",
"to",
"the",
"given",
"destination",
"Memory",
".",
"Called",
"by",
"SetOperation",
".",
"Builder",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java#L74-L98 |
55,103 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java | IntersectionImpl.heapifyInstance | static IntersectionImplR heapifyInstance(final Memory srcMem, final long seed) {
final IntersectionImpl impl = new IntersectionImpl(null, seed, false);
//Get Preamble
//Note: Intersection does not use lgNomLongs (or k), per se.
//seedHash loaded and checked in private constructor
final int preLongs... | java | static IntersectionImplR heapifyInstance(final Memory srcMem, final long seed) {
final IntersectionImpl impl = new IntersectionImpl(null, seed, false);
//Get Preamble
//Note: Intersection does not use lgNomLongs (or k), per se.
//seedHash loaded and checked in private constructor
final int preLongs... | [
"static",
"IntersectionImplR",
"heapifyInstance",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"IntersectionImpl",
"impl",
"=",
"new",
"IntersectionImpl",
"(",
"null",
",",
"seed",
",",
"false",
")",
";",
"//Get Preamble",
... | Heapify an intersection target from a Memory image containing data.
@param srcMem The source Memory object.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@return a IntersectionImplR instance on the Java heap | [
"Heapify",
"an",
"intersection",
"target",
"from",
"a",
"Memory",
"image",
"containing",
"data",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java#L107-L155 |
55,104 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/tuple/Intersection.java | Intersection.update | @SuppressWarnings({ "unchecked", "null" })
public void update(final Sketch<S> sketchIn) {
final boolean isFirstCall = isFirstCall_;
isFirstCall_ = false;
if (sketchIn == null) {
isEmpty_ = true;
sketch_ = null;
return;
}
theta_ = min(theta_, sketchIn.getThetaLong());
isEmpty_... | java | @SuppressWarnings({ "unchecked", "null" })
public void update(final Sketch<S> sketchIn) {
final boolean isFirstCall = isFirstCall_;
isFirstCall_ = false;
if (sketchIn == null) {
isEmpty_ = true;
sketch_ = null;
return;
}
theta_ = min(theta_, sketchIn.getThetaLong());
isEmpty_... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"null\"",
"}",
")",
"public",
"void",
"update",
"(",
"final",
"Sketch",
"<",
"S",
">",
"sketchIn",
")",
"{",
"final",
"boolean",
"isFirstCall",
"=",
"isFirstCall_",
";",
"isFirstCall_",
"=",
"false",... | Updates the internal set by intersecting it with the given sketch
@param sketchIn input sketch to intersect with the internal set | [
"Updates",
"the",
"internal",
"set",
"by",
"intersecting",
"it",
"with",
"the",
"given",
"sketch"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/tuple/Intersection.java#L45-L101 |
55,105 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/BinomialBoundsN.java | BinomialBoundsN.contClassicLB | private static double contClassicLB(final double numSamplesF, final double theta,
final double numSDev) {
final double nHat = (numSamplesF - 0.5) / theta;
final double b = numSDev * Math.sqrt((1.0 - theta) / theta);
final double d = 0.5 * b * Math.sqrt((b * b) + (4.0 * nHat));
final double center... | java | private static double contClassicLB(final double numSamplesF, final double theta,
final double numSDev) {
final double nHat = (numSamplesF - 0.5) / theta;
final double b = numSDev * Math.sqrt((1.0 - theta) / theta);
final double d = 0.5 * b * Math.sqrt((b * b) + (4.0 * nHat));
final double center... | [
"private",
"static",
"double",
"contClassicLB",
"(",
"final",
"double",
"numSamplesF",
",",
"final",
"double",
"theta",
",",
"final",
"double",
"numSDev",
")",
"{",
"final",
"double",
"nHat",
"=",
"(",
"numSamplesF",
"-",
"0.5",
")",
"/",
"theta",
";",
"fi... | our "classic" bounds, but now with continuity correction | [
"our",
"classic",
"bounds",
"but",
"now",
"with",
"continuity",
"correction"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BinomialBoundsN.java#L32-L39 |
55,106 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/BinomialBoundsN.java | BinomialBoundsN.getLowerBound | public static double getLowerBound(final long numSamples, final double theta, final int numSDev,
final boolean noDataSeen) {
//in earlier code numSamples was called numSamplesI
if (noDataSeen) { return 0.0; }
checkArgs(numSamples, theta, numSDev);
final double lb = computeApproxBinoLB(numSamples, ... | java | public static double getLowerBound(final long numSamples, final double theta, final int numSDev,
final boolean noDataSeen) {
//in earlier code numSamples was called numSamplesI
if (noDataSeen) { return 0.0; }
checkArgs(numSamples, theta, numSDev);
final double lb = computeApproxBinoLB(numSamples, ... | [
"public",
"static",
"double",
"getLowerBound",
"(",
"final",
"long",
"numSamples",
",",
"final",
"double",
"theta",
",",
"final",
"int",
"numSDev",
",",
"final",
"boolean",
"noDataSeen",
")",
"{",
"//in earlier code numSamples was called numSamplesI",
"if",
"(",
"no... | Returns the approximate lower bound value
@param numSamples the number of samples in the sample set
@param theta the sampling probability
@param numSDev the number of "standard deviations" from the mean for the tail bounds.
This must be an integer value of 1, 2 or 3.
@param noDataSeen this is normally false. However, i... | [
"Returns",
"the",
"approximate",
"lower",
"bound",
"value"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BinomialBoundsN.java#L218-L227 |
55,107 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/BinomialBoundsN.java | BinomialBoundsN.getUpperBound | public static double getUpperBound(final long numSamples, final double theta, final int numSDev,
final boolean noDataSeen) {
//in earlier code numSamples was called numSamplesI
if (noDataSeen) { return 0.0; }
checkArgs(numSamples, theta, numSDev);
final double ub = computeApproxBinoUB(numSamples, ... | java | public static double getUpperBound(final long numSamples, final double theta, final int numSDev,
final boolean noDataSeen) {
//in earlier code numSamples was called numSamplesI
if (noDataSeen) { return 0.0; }
checkArgs(numSamples, theta, numSDev);
final double ub = computeApproxBinoUB(numSamples, ... | [
"public",
"static",
"double",
"getUpperBound",
"(",
"final",
"long",
"numSamples",
",",
"final",
"double",
"theta",
",",
"final",
"int",
"numSDev",
",",
"final",
"boolean",
"noDataSeen",
")",
"{",
"//in earlier code numSamples was called numSamplesI",
"if",
"(",
"no... | Returns the approximate upper bound value
@param numSamples the number of samples in the sample set
@param theta the sampling probability
@param numSDev the number of "standard deviations" from the mean for the tail bounds.
This must be an integer value of 1, 2 or 3.
@param noDataSeen this is normally false. However, i... | [
"Returns",
"the",
"approximate",
"upper",
"bound",
"value"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BinomialBoundsN.java#L241-L250 |
55,108 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/BinomialBoundsN.java | BinomialBoundsN.checkArgs | static final void checkArgs(final long numSamples, final double theta, final int numSDev) {
if ((numSDev | (numSDev - 1) | (3 - numSDev) | numSamples) < 0) {
throw new SketchesArgumentException(
"numSDev must only be 1,2, or 3 and numSamples must >= 0: numSDev="
+ numSDev + ", numSampl... | java | static final void checkArgs(final long numSamples, final double theta, final int numSDev) {
if ((numSDev | (numSDev - 1) | (3 - numSDev) | numSamples) < 0) {
throw new SketchesArgumentException(
"numSDev must only be 1,2, or 3 and numSamples must >= 0: numSDev="
+ numSDev + ", numSampl... | [
"static",
"final",
"void",
"checkArgs",
"(",
"final",
"long",
"numSamples",
",",
"final",
"double",
"theta",
",",
"final",
"int",
"numSDev",
")",
"{",
"if",
"(",
"(",
"numSDev",
"|",
"(",
"numSDev",
"-",
"1",
")",
"|",
"(",
"3",
"-",
"numSDev",
")",
... | exposed only for test | [
"exposed",
"only",
"for",
"test"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BinomialBoundsN.java#L253-L262 |
55,109 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java | ReservoirItemsUnion.update | public void update(final ReservoirItemsSketch<T> sketchIn) {
if (sketchIn == null) {
return;
}
final ReservoirItemsSketch<T> ris =
(sketchIn.getK() <= maxK_ ? sketchIn : sketchIn.downsampledCopy(maxK_));
// can modify the sketch if we downsampled, otherwise may need to copy it
final ... | java | public void update(final ReservoirItemsSketch<T> sketchIn) {
if (sketchIn == null) {
return;
}
final ReservoirItemsSketch<T> ris =
(sketchIn.getK() <= maxK_ ? sketchIn : sketchIn.downsampledCopy(maxK_));
// can modify the sketch if we downsampled, otherwise may need to copy it
final ... | [
"public",
"void",
"update",
"(",
"final",
"ReservoirItemsSketch",
"<",
"T",
">",
"sketchIn",
")",
"{",
"if",
"(",
"sketchIn",
"==",
"null",
")",
"{",
"return",
";",
"}",
"final",
"ReservoirItemsSketch",
"<",
"T",
">",
"ris",
"=",
"(",
"sketchIn",
".",
... | Union the given sketch. This method can be repeatedly called. If the given sketch is null it is
interpreted as an empty sketch.
@param sketchIn The incoming sketch. | [
"Union",
"the",
"given",
"sketch",
".",
"This",
"method",
"can",
"be",
"repeatedly",
"called",
".",
"If",
"the",
"given",
"sketch",
"is",
"null",
"it",
"is",
"interpreted",
"as",
"an",
"empty",
"sketch",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java#L134-L149 |
55,110 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java | ReservoirItemsUnion.update | public void update(final T datum) {
if (datum == null) {
return;
}
if (gadget_ == null) {
gadget_ = ReservoirItemsSketch.newInstance(maxK_);
}
gadget_.update(datum);
} | java | public void update(final T datum) {
if (datum == null) {
return;
}
if (gadget_ == null) {
gadget_ = ReservoirItemsSketch.newInstance(maxK_);
}
gadget_.update(datum);
} | [
"public",
"void",
"update",
"(",
"final",
"T",
"datum",
")",
"{",
"if",
"(",
"datum",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"gadget_",
"==",
"null",
")",
"{",
"gadget_",
"=",
"ReservoirItemsSketch",
".",
"newInstance",
"(",
"maxK_",
... | Present this union with a single item to be added to the union.
@param datum The given datum of type T. | [
"Present",
"this",
"union",
"with",
"a",
"single",
"item",
"to",
"be",
"added",
"to",
"the",
"union",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java#L180-L189 |
55,111 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java | ReservoirItemsUnion.toByteArray | public byte[] toByteArray(final ArrayOfItemsSerDe<T> serDe) {
if ((gadget_ == null) || (gadget_.getNumSamples() == 0)) {
return toByteArray(serDe, null);
} else {
return toByteArray(serDe, gadget_.getValueAtPosition(0).getClass());
}
} | java | public byte[] toByteArray(final ArrayOfItemsSerDe<T> serDe) {
if ((gadget_ == null) || (gadget_.getNumSamples() == 0)) {
return toByteArray(serDe, null);
} else {
return toByteArray(serDe, gadget_.getValueAtPosition(0).getClass());
}
} | [
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
"final",
"ArrayOfItemsSerDe",
"<",
"T",
">",
"serDe",
")",
"{",
"if",
"(",
"(",
"gadget_",
"==",
"null",
")",
"||",
"(",
"gadget_",
".",
"getNumSamples",
"(",
")",
"==",
"0",
")",
")",
"{",
"return",
... | Returns a byte array representation of this union
@param serDe An instance of ArrayOfItemsSerDe
@return a byte array representation of this union | [
"Returns",
"a",
"byte",
"array",
"representation",
"of",
"this",
"union"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirItemsUnion.java#L235-L241 |
55,112 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hll/RelativeErrorTables.java | RelativeErrorTables.getRelErr | static double getRelErr(final boolean upperBound, final boolean oooFlag,
final int lgK, final int stdDev) {
final int idx = ((lgK - 4) * 3) + (stdDev - 1);
final int sw = (oooFlag ? 2 : 0) | (upperBound ? 1 : 0);
double f = 0;
switch (sw) {
case 0 : { //HIP, LB
f = HIP_LB[idx];
... | java | static double getRelErr(final boolean upperBound, final boolean oooFlag,
final int lgK, final int stdDev) {
final int idx = ((lgK - 4) * 3) + (stdDev - 1);
final int sw = (oooFlag ? 2 : 0) | (upperBound ? 1 : 0);
double f = 0;
switch (sw) {
case 0 : { //HIP, LB
f = HIP_LB[idx];
... | [
"static",
"double",
"getRelErr",
"(",
"final",
"boolean",
"upperBound",
",",
"final",
"boolean",
"oooFlag",
",",
"final",
"int",
"lgK",
",",
"final",
"int",
"stdDev",
")",
"{",
"final",
"int",
"idx",
"=",
"(",
"(",
"lgK",
"-",
"4",
")",
"*",
"3",
")"... | Return Relative Error for UB or LB for HIP or Non-HIP as a function of numStdDev.
@param upperBound true if for upper bound
@param oooFlag true if for Non-HIP
@param lgK must be between 4 and 12 inclusive
@param stdDev must be between 1 and 3 inclusive
@return Relative Error for UB or LB for HIP or Non-HIP as a functio... | [
"Return",
"Relative",
"Error",
"for",
"UB",
"or",
"LB",
"for",
"HIP",
"or",
"Non",
"-",
"HIP",
"as",
"a",
"function",
"of",
"numStdDev",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/RelativeErrorTables.java#L22-L46 |
55,113 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/cpc/CpcWrapper.java | CpcWrapper.getEstimate | public double getEstimate() {
if (!hasHip(mem)) {
return getIconEstimate(PreambleUtil.getLgK(mem), getNumCoupons(mem));
}
return getHipAccum(mem);
} | java | public double getEstimate() {
if (!hasHip(mem)) {
return getIconEstimate(PreambleUtil.getLgK(mem), getNumCoupons(mem));
}
return getHipAccum(mem);
} | [
"public",
"double",
"getEstimate",
"(",
")",
"{",
"if",
"(",
"!",
"hasHip",
"(",
"mem",
")",
")",
"{",
"return",
"getIconEstimate",
"(",
"PreambleUtil",
".",
"getLgK",
"(",
"mem",
")",
",",
"getNumCoupons",
"(",
"mem",
")",
")",
";",
"}",
"return",
"... | Returns the best estimate of the cardinality of the sketch.
@return the best estimate of the cardinality of the sketch. | [
"Returns",
"the",
"best",
"estimate",
"of",
"the",
"cardinality",
"of",
"the",
"sketch",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/cpc/CpcWrapper.java#L55-L60 |
55,114 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/HeapCompactOrderedSketch.java | HeapCompactOrderedSketch.heapifyInstance | static CompactSketch heapifyInstance(final Memory srcMem, final long seed) {
final short memSeedHash = (short) extractSeedHash(srcMem);
final short computedSeedHash = computeSeedHash(seed);
checkSeedHashes(memSeedHash, computedSeedHash);
final int preLongs = extractPreLongs(srcMem);
final boolean e... | java | static CompactSketch heapifyInstance(final Memory srcMem, final long seed) {
final short memSeedHash = (short) extractSeedHash(srcMem);
final short computedSeedHash = computeSeedHash(seed);
checkSeedHashes(memSeedHash, computedSeedHash);
final int preLongs = extractPreLongs(srcMem);
final boolean e... | [
"static",
"CompactSketch",
"heapifyInstance",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"short",
"memSeedHash",
"=",
"(",
"short",
")",
"extractSeedHash",
"(",
"srcMem",
")",
";",
"final",
"short",
"computedSeedHash",
"... | Heapifies the given source Memory with seed
@param srcMem <a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See Update Hash Seed</a>.
@return a CompactSketch | [
"Heapifies",
"the",
"given",
"source",
"Memory",
"with",
"seed"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/HeapCompactOrderedSketch.java#L45-L72 |
55,115 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/HeapCompactOrderedSketch.java | HeapCompactOrderedSketch.compact | static CompactSketch compact(final UpdateSketch sketch) {
final int curCount = sketch.getRetainedEntries(true);
long thetaLong = sketch.getThetaLong();
boolean empty = sketch.isEmpty();
thetaLong = thetaOnCompact(empty, curCount, thetaLong);
empty = emptyOnCompact(curCount, thetaLong);
final sho... | java | static CompactSketch compact(final UpdateSketch sketch) {
final int curCount = sketch.getRetainedEntries(true);
long thetaLong = sketch.getThetaLong();
boolean empty = sketch.isEmpty();
thetaLong = thetaOnCompact(empty, curCount, thetaLong);
empty = emptyOnCompact(curCount, thetaLong);
final sho... | [
"static",
"CompactSketch",
"compact",
"(",
"final",
"UpdateSketch",
"sketch",
")",
"{",
"final",
"int",
"curCount",
"=",
"sketch",
".",
"getRetainedEntries",
"(",
"true",
")",
";",
"long",
"thetaLong",
"=",
"sketch",
".",
"getThetaLong",
"(",
")",
";",
"bool... | Converts the given UpdateSketch to this compact form.
@param sketch the given UpdateSketch
@return a CompactSketch | [
"Converts",
"the",
"given",
"UpdateSketch",
"to",
"this",
"compact",
"form",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/HeapCompactOrderedSketch.java#L79-L93 |
55,116 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/QuickSelect.java | QuickSelect.select | public static double select(final double[] arr, int lo, int hi, final int pivot) {
while (hi > lo) {
final int j = partition(arr, lo, hi);
if (j == pivot) {
return arr[pivot];
}
if (j > pivot) {
hi = j - 1;
}
else {
lo = j + 1;
}
}
return arr... | java | public static double select(final double[] arr, int lo, int hi, final int pivot) {
while (hi > lo) {
final int j = partition(arr, lo, hi);
if (j == pivot) {
return arr[pivot];
}
if (j > pivot) {
hi = j - 1;
}
else {
lo = j + 1;
}
}
return arr... | [
"public",
"static",
"double",
"select",
"(",
"final",
"double",
"[",
"]",
"arr",
",",
"int",
"lo",
",",
"int",
"hi",
",",
"final",
"int",
"pivot",
")",
"{",
"while",
"(",
"hi",
">",
"lo",
")",
"{",
"final",
"int",
"j",
"=",
"partition",
"(",
"arr... | Gets the 0-based kth order statistic from the array. Warning! This changes the ordering
of elements in the given array!
@param arr The array to be re-arranged.
@param lo The lowest 0-based index to be considered.
@param hi The highest 0-based index to be considered.
@param pivot The 0-based smallest value to pivot on.... | [
"Gets",
"the",
"0",
"-",
"based",
"kth",
"order",
"statistic",
"from",
"the",
"array",
".",
"Warning!",
"This",
"changes",
"the",
"ordering",
"of",
"elements",
"in",
"the",
"given",
"array!"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/QuickSelect.java#L136-L150 |
55,117 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/QuickSelect.java | QuickSelect.selectIncludingZeros | public static double selectIncludingZeros(final double[] arr, final int pivot) {
final int arrSize = arr.length;
final int adj = pivot - 1;
return select(arr, 0, arrSize - 1, adj);
} | java | public static double selectIncludingZeros(final double[] arr, final int pivot) {
final int arrSize = arr.length;
final int adj = pivot - 1;
return select(arr, 0, arrSize - 1, adj);
} | [
"public",
"static",
"double",
"selectIncludingZeros",
"(",
"final",
"double",
"[",
"]",
"arr",
",",
"final",
"int",
"pivot",
")",
"{",
"final",
"int",
"arrSize",
"=",
"arr",
".",
"length",
";",
"final",
"int",
"adj",
"=",
"pivot",
"-",
"1",
";",
"retur... | Gets the 1-based kth order statistic from the array including any zero values in the
array. Warning! This changes the ordering of elements in the given array!
@param arr The hash array.
@param pivot The 1-based index of the value that is chosen as the pivot for the array.
After the operation all values below this 1-ba... | [
"Gets",
"the",
"1",
"-",
"based",
"kth",
"order",
"statistic",
"from",
"the",
"array",
"including",
"any",
"zero",
"values",
"in",
"the",
"array",
".",
"Warning!",
"This",
"changes",
"the",
"ordering",
"of",
"elements",
"in",
"the",
"given",
"array!"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/QuickSelect.java#L163-L167 |
55,118 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/QuickSelect.java | QuickSelect.selectExcludingZeros | public static double selectExcludingZeros(final double[] arr, final int nonZeros, final int pivot) {
if (pivot > nonZeros) {
return 0L;
}
final int arrSize = arr.length;
final int zeros = arrSize - nonZeros;
final int adjK = (pivot + zeros) - 1;
return select(arr, 0, arrSize - 1, adjK);
... | java | public static double selectExcludingZeros(final double[] arr, final int nonZeros, final int pivot) {
if (pivot > nonZeros) {
return 0L;
}
final int arrSize = arr.length;
final int zeros = arrSize - nonZeros;
final int adjK = (pivot + zeros) - 1;
return select(arr, 0, arrSize - 1, adjK);
... | [
"public",
"static",
"double",
"selectExcludingZeros",
"(",
"final",
"double",
"[",
"]",
"arr",
",",
"final",
"int",
"nonZeros",
",",
"final",
"int",
"pivot",
")",
"{",
"if",
"(",
"pivot",
">",
"nonZeros",
")",
"{",
"return",
"0L",
";",
"}",
"final",
"i... | Gets the 1-based kth order statistic from the array excluding any zero values in the
array. Warning! This changes the ordering of elements in the given array!
@param arr The hash array.
@param nonZeros The number of non-zero values in the array.
@param pivot The 1-based index of the value that is chosen as the pivot f... | [
"Gets",
"the",
"1",
"-",
"based",
"kth",
"order",
"statistic",
"from",
"the",
"array",
"excluding",
"any",
"zero",
"values",
"in",
"the",
"array",
".",
"Warning!",
"This",
"changes",
"the",
"ordering",
"of",
"elements",
"in",
"the",
"given",
"array!"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/QuickSelect.java#L181-L189 |
55,119 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/hll/CouponHashSet.java | CouponHashSet.heapifySet | static final CouponHashSet heapifySet(final Memory mem) {
final int lgConfigK = extractLgK(mem);
final TgtHllType tgtHllType = extractTgtHllType(mem);
final CurMode curMode = extractCurMode(mem);
final int memArrStart = (curMode == CurMode.LIST) ? LIST_INT_ARR_START : HASH_SET_INT_ARR_START;
final ... | java | static final CouponHashSet heapifySet(final Memory mem) {
final int lgConfigK = extractLgK(mem);
final TgtHllType tgtHllType = extractTgtHllType(mem);
final CurMode curMode = extractCurMode(mem);
final int memArrStart = (curMode == CurMode.LIST) ? LIST_INT_ARR_START : HASH_SET_INT_ARR_START;
final ... | [
"static",
"final",
"CouponHashSet",
"heapifySet",
"(",
"final",
"Memory",
"mem",
")",
"{",
"final",
"int",
"lgConfigK",
"=",
"extractLgK",
"(",
"mem",
")",
";",
"final",
"TgtHllType",
"tgtHllType",
"=",
"extractTgtHllType",
"(",
"mem",
")",
";",
"final",
"Cu... | will also accept List, but results in a Set | [
"will",
"also",
"accept",
"List",
"but",
"results",
"in",
"a",
"Set"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/hll/CouponHashSet.java#L61-L87 |
55,120 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/HeapQuickSelectSketch.java | HeapQuickSelectSketch.heapifyInstance | static HeapQuickSelectSketch heapifyInstance(final Memory srcMem, final long seed) {
final int preambleLongs = extractPreLongs(srcMem); //byte 0
final int lgNomLongs = extractLgNomLongs(srcMem); //byte 3
final int lgArrLongs = extractLgArrLongs(srcMem); //byte 4
check... | java | static HeapQuickSelectSketch heapifyInstance(final Memory srcMem, final long seed) {
final int preambleLongs = extractPreLongs(srcMem); //byte 0
final int lgNomLongs = extractLgNomLongs(srcMem); //byte 3
final int lgArrLongs = extractLgArrLongs(srcMem); //byte 4
check... | [
"static",
"HeapQuickSelectSketch",
"heapifyInstance",
"(",
"final",
"Memory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"int",
"preambleLongs",
"=",
"extractPreLongs",
"(",
"srcMem",
")",
";",
"//byte 0",
"final",
"int",
"lgNomLongs",
"=",
"extr... | Heapify a sketch from a Memory UpdateSketch or Union object
containing sketch data.
@param srcMem The source Memory object.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@return instance of this sketch | [
"Heapify",
"a",
"sketch",
"from",
"a",
"Memory",
"UpdateSketch",
"or",
"Union",
"object",
"containing",
"sketch",
"data",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/HeapQuickSelectSketch.java#L97-L126 |
55,121 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/HeapQuickSelectSketch.java | HeapQuickSelectSketch.quickSelectAndRebuild | private final void quickSelectAndRebuild() {
final int arrLongs = 1 << lgArrLongs_;
final int pivot = (1 << lgNomLongs_) + 1; // pivot for QS
thetaLong_ = selectExcludingZeros(cache_, curCount_, pivot); //messes up the cache_
// now we rebuild to clean up dirty data, update count, reconfigure as a ha... | java | private final void quickSelectAndRebuild() {
final int arrLongs = 1 << lgArrLongs_;
final int pivot = (1 << lgNomLongs_) + 1; // pivot for QS
thetaLong_ = selectExcludingZeros(cache_, curCount_, pivot); //messes up the cache_
// now we rebuild to clean up dirty data, update count, reconfigure as a ha... | [
"private",
"final",
"void",
"quickSelectAndRebuild",
"(",
")",
"{",
"final",
"int",
"arrLongs",
"=",
"1",
"<<",
"lgArrLongs_",
";",
"final",
"int",
"pivot",
"=",
"(",
"1",
"<<",
"lgNomLongs_",
")",
"+",
"1",
";",
"// pivot for QS",
"thetaLong_",
"=",
"sele... | array stays the same size. Changes theta and thus count | [
"array",
"stays",
"the",
"same",
"size",
".",
"Changes",
"theta",
"and",
"thus",
"count"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/HeapQuickSelectSketch.java#L277-L289 |
55,122 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/VarOptItemsSamples.java | VarOptItemsSamples.items | public T items(final int i) {
loadArrays();
return (sampleLists == null ? null : sampleLists.items[i]);
} | java | public T items(final int i) {
loadArrays();
return (sampleLists == null ? null : sampleLists.items[i]);
} | [
"public",
"T",
"items",
"(",
"final",
"int",
"i",
")",
"{",
"loadArrays",
"(",
")",
";",
"return",
"(",
"sampleLists",
"==",
"null",
"?",
"null",
":",
"sampleLists",
".",
"items",
"[",
"i",
"]",
")",
";",
"}"
] | Returns a single item from the samples contained in the sketch. Does not perform bounds
checking on the input. If this is the first getter call, copies data arrays from the sketch.
@param i An index into the list of samples
@return The sample at array position <tt>i</tt> | [
"Returns",
"a",
"single",
"item",
"from",
"the",
"samples",
"contained",
"in",
"the",
"sketch",
".",
"Does",
"not",
"perform",
"bounds",
"checking",
"on",
"the",
"input",
".",
"If",
"this",
"is",
"the",
"first",
"getter",
"call",
"copies",
"data",
"arrays"... | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSamples.java#L227-L230 |
55,123 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/VarOptItemsSamples.java | VarOptItemsSamples.weights | public double weights(final int i) {
loadArrays();
return (sampleLists == null ? Double.NaN : sampleLists.weights[i]);
} | java | public double weights(final int i) {
loadArrays();
return (sampleLists == null ? Double.NaN : sampleLists.weights[i]);
} | [
"public",
"double",
"weights",
"(",
"final",
"int",
"i",
")",
"{",
"loadArrays",
"(",
")",
";",
"return",
"(",
"sampleLists",
"==",
"null",
"?",
"Double",
".",
"NaN",
":",
"sampleLists",
".",
"weights",
"[",
"i",
"]",
")",
";",
"}"
] | Returns a single weight from the samples contained in the sketch. Does not perform bounds
checking on the input. If this is the first getter call, copies data arrays from the sketch.
@param i An index into the list of weights
@return The weight at array position <tt>i</tt> | [
"Returns",
"a",
"single",
"weight",
"from",
"the",
"samples",
"contained",
"in",
"the",
"sketch",
".",
"Does",
"not",
"perform",
"bounds",
"checking",
"on",
"the",
"input",
".",
"If",
"this",
"is",
"the",
"first",
"getter",
"call",
"copies",
"data",
"array... | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSamples.java#L248-L251 |
55,124 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SetOperationBuilder.java | SetOperationBuilder.setNominalEntries | public SetOperationBuilder setNominalEntries(final int nomEntries) {
bLgNomLongs = Integer.numberOfTrailingZeros(ceilingPowerOf2(nomEntries));
if ((bLgNomLongs > MAX_LG_NOM_LONGS) || (bLgNomLongs < MIN_LG_NOM_LONGS)) {
throw new SketchesArgumentException("Nominal Entries must be >= 16 and <= 67108864: "
... | java | public SetOperationBuilder setNominalEntries(final int nomEntries) {
bLgNomLongs = Integer.numberOfTrailingZeros(ceilingPowerOf2(nomEntries));
if ((bLgNomLongs > MAX_LG_NOM_LONGS) || (bLgNomLongs < MIN_LG_NOM_LONGS)) {
throw new SketchesArgumentException("Nominal Entries must be >= 16 and <= 67108864: "
... | [
"public",
"SetOperationBuilder",
"setNominalEntries",
"(",
"final",
"int",
"nomEntries",
")",
"{",
"bLgNomLongs",
"=",
"Integer",
".",
"numberOfTrailingZeros",
"(",
"ceilingPowerOf2",
"(",
"nomEntries",
")",
")",
";",
"if",
"(",
"(",
"bLgNomLongs",
">",
"MAX_LG_NO... | Sets the Nominal Entries for this set operation. The minimum value is 16 and the maximum value
is 67,108,864, which is 2^26. Be aware that Unions as large as this maximum value have not
been thoroughly tested or characterized for performance.
@param nomEntries <a href="{@docRoot}/resources/dictionary.html#nomEntries">N... | [
"Sets",
"the",
"Nominal",
"Entries",
"for",
"this",
"set",
"operation",
".",
"The",
"minimum",
"value",
"is",
"16",
"and",
"the",
"maximum",
"value",
"is",
"67",
"108",
"864",
"which",
"is",
"2^26",
".",
"Be",
"aware",
"that",
"Unions",
"as",
"large",
... | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperationBuilder.java#L61-L68 |
55,125 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/SetOperationBuilder.java | SetOperationBuilder.build | public SetOperation build(final Family family, final WritableMemory dstMem) {
SetOperation setOp = null;
switch (family) {
case UNION: {
if (dstMem == null) {
setOp = UnionImpl.initNewHeapInstance(bLgNomLongs, bSeed, bP, bRF);
}
else {
setOp = UnionImpl.initNewD... | java | public SetOperation build(final Family family, final WritableMemory dstMem) {
SetOperation setOp = null;
switch (family) {
case UNION: {
if (dstMem == null) {
setOp = UnionImpl.initNewHeapInstance(bLgNomLongs, bSeed, bP, bRF);
}
else {
setOp = UnionImpl.initNewD... | [
"public",
"SetOperation",
"build",
"(",
"final",
"Family",
"family",
",",
"final",
"WritableMemory",
"dstMem",
")",
"{",
"SetOperation",
"setOp",
"=",
"null",
";",
"switch",
"(",
"family",
")",
"{",
"case",
"UNION",
":",
"{",
"if",
"(",
"dstMem",
"==",
"... | Returns a SetOperation with the current configuration of this Builder, the given Family
and the given destination memory. Note that the destination memory cannot be used with AnotB.
@param family the chosen SetOperation family
@param dstMem The destination Memory.
@return a SetOperation | [
"Returns",
"a",
"SetOperation",
"with",
"the",
"current",
"configuration",
"of",
"this",
"Builder",
"the",
"given",
"Family",
"and",
"the",
"given",
"destination",
"memory",
".",
"Note",
"that",
"the",
"destination",
"memory",
"cannot",
"be",
"used",
"with",
"... | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/SetOperationBuilder.java#L173-L209 |
55,126 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMap.java | ReversePurgeLongHashMap.getInstance | static ReversePurgeLongHashMap getInstance(final String string) {
final String[] tokens = string.split(",");
if (tokens.length < 2) {
throw new SketchesArgumentException(
"String not long enough to specify length and capacity.");
}
final int numActive = Integer.parseInt(tokens[0]);
f... | java | static ReversePurgeLongHashMap getInstance(final String string) {
final String[] tokens = string.split(",");
if (tokens.length < 2) {
throw new SketchesArgumentException(
"String not long enough to specify length and capacity.");
}
final int numActive = Integer.parseInt(tokens[0]);
f... | [
"static",
"ReversePurgeLongHashMap",
"getInstance",
"(",
"final",
"String",
"string",
")",
"{",
"final",
"String",
"[",
"]",
"tokens",
"=",
"string",
".",
"split",
"(",
"\",\"",
")",
";",
"if",
"(",
"tokens",
".",
"length",
"<",
"2",
")",
"{",
"throw",
... | Returns an instance of this class from the given String,
which must be a String representation of this class.
@param string a String representation of this class.
@return an instance of this class. | [
"Returns",
"an",
"instance",
"of",
"this",
"class",
"from",
"the",
"given",
"String",
"which",
"must",
"be",
"a",
"String",
"representation",
"of",
"this",
"class",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMap.java#L59-L75 |
55,127 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMap.java | ReversePurgeLongHashMap.serializeToString | String serializeToString() {
final StringBuilder sb = new StringBuilder();
sb.append(String.format("%d,%d,", numActive, keys.length));
for (int i = 0; i < keys.length; i++) {
if (states[i] != 0) {
sb.append(String.format("%d,%d,", keys[i], values[i]));
}
}
return sb.toString();
... | java | String serializeToString() {
final StringBuilder sb = new StringBuilder();
sb.append(String.format("%d,%d,", numActive, keys.length));
for (int i = 0; i < keys.length; i++) {
if (states[i] != 0) {
sb.append(String.format("%d,%d,", keys[i], values[i]));
}
}
return sb.toString();
... | [
"String",
"serializeToString",
"(",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"String",
".",
"format",
"(",
"\"%d,%d,\"",
",",
"numActive",
",",
"keys",
".",
"length",
")",
")",
";",
... | Returns a String representation of this hash map.
@return a String representation of this hash map. | [
"Returns",
"a",
"String",
"representation",
"of",
"this",
"hash",
"map",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMap.java#L84-L94 |
55,128 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMap.java | ReversePurgeLongHashMap.keepOnlyPositiveCounts | void keepOnlyPositiveCounts() {
// Starting from the back, find the first empty cell, which marks a boundary between clusters.
int firstProbe = keys.length - 1;
while (states[firstProbe] > 0) {
firstProbe--;
}
//Work towards the front; delete any non-positive entries.
for (int probe = fir... | java | void keepOnlyPositiveCounts() {
// Starting from the back, find the first empty cell, which marks a boundary between clusters.
int firstProbe = keys.length - 1;
while (states[firstProbe] > 0) {
firstProbe--;
}
//Work towards the front; delete any non-positive entries.
for (int probe = fir... | [
"void",
"keepOnlyPositiveCounts",
"(",
")",
"{",
"// Starting from the back, find the first empty cell, which marks a boundary between clusters.",
"int",
"firstProbe",
"=",
"keys",
".",
"length",
"-",
"1",
";",
"while",
"(",
"states",
"[",
"firstProbe",
"]",
">",
"0",
"... | Processes the map arrays and retains only keys with positive counts. | [
"Processes",
"the",
"map",
"arrays",
"and",
"retains",
"only",
"keys",
"with",
"positive",
"counts",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/frequencies/ReversePurgeLongHashMap.java#L154-L177 |
55,129 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSets.java | BoundsOnRatiosInThetaSketchedSets.getLowerBoundForBoverA | public static double getLowerBoundForBoverA(final Sketch sketchA, final Sketch sketchB) {
final double thetaA = sketchA.getTheta();
final double thetaB = sketchB.getTheta();
checkThetas(thetaA, thetaB);
final int countB = sketchB.getRetainedEntries(true);
final int countA = (thetaB == thetaA) ? ske... | java | public static double getLowerBoundForBoverA(final Sketch sketchA, final Sketch sketchB) {
final double thetaA = sketchA.getTheta();
final double thetaB = sketchB.getTheta();
checkThetas(thetaA, thetaB);
final int countB = sketchB.getRetainedEntries(true);
final int countA = (thetaB == thetaA) ? ske... | [
"public",
"static",
"double",
"getLowerBoundForBoverA",
"(",
"final",
"Sketch",
"sketchA",
",",
"final",
"Sketch",
"sketchB",
")",
"{",
"final",
"double",
"thetaA",
"=",
"sketchA",
".",
"getTheta",
"(",
")",
";",
"final",
"double",
"thetaB",
"=",
"sketchB",
... | Gets the approximate lower bound for B over A based on a 95% confidence interval
@param sketchA the sketch A
@param sketchB the sketch B
@return the approximate lower bound for B over A | [
"Gets",
"the",
"approximate",
"lower",
"bound",
"for",
"B",
"over",
"A",
"based",
"on",
"a",
"95%",
"confidence",
"interval"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/BoundsOnRatiosInThetaSketchedSets.java#L41-L53 |
55,130 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/quantiles/ItemsMergeImpl.java | ItemsMergeImpl.blockyTandemMergeSort | static <T> void blockyTandemMergeSort(final T[] keyArr, final long[] valArr, final int arrLen,
final int blkSize, final Comparator<? super T> comparator) {
assert blkSize >= 1;
if (arrLen <= blkSize) { return; }
int numblks = arrLen / blkSize;
if ((numblks * blkSize) < arrLen) { numblks += 1; }
... | java | static <T> void blockyTandemMergeSort(final T[] keyArr, final long[] valArr, final int arrLen,
final int blkSize, final Comparator<? super T> comparator) {
assert blkSize >= 1;
if (arrLen <= blkSize) { return; }
int numblks = arrLen / blkSize;
if ((numblks * blkSize) < arrLen) { numblks += 1; }
... | [
"static",
"<",
"T",
">",
"void",
"blockyTandemMergeSort",
"(",
"final",
"T",
"[",
"]",
"keyArr",
",",
"final",
"long",
"[",
"]",
"valArr",
",",
"final",
"int",
"arrLen",
",",
"final",
"int",
"blkSize",
",",
"final",
"Comparator",
"<",
"?",
"super",
"T"... | also used by ItemsAuxiliary | [
"also",
"used",
"by",
"ItemsAuxiliary"
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/quantiles/ItemsMergeImpl.java#L216-L232 |
55,131 | DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirSize.java | ReservoirSize.decodeValue | public static int decodeValue(final short encodedSize) {
final int value = encodedSize & 0xFFFF;
if (value > MAX_ENC_VALUE) {
throw new SketchesArgumentException("Maximum valid encoded value is "
+ Integer.toHexString(MAX_ENC_VALUE) + ", found: " + value);
}
final int p = (value >>... | java | public static int decodeValue(final short encodedSize) {
final int value = encodedSize & 0xFFFF;
if (value > MAX_ENC_VALUE) {
throw new SketchesArgumentException("Maximum valid encoded value is "
+ Integer.toHexString(MAX_ENC_VALUE) + ", found: " + value);
}
final int p = (value >>... | [
"public",
"static",
"int",
"decodeValue",
"(",
"final",
"short",
"encodedSize",
")",
"{",
"final",
"int",
"value",
"=",
"encodedSize",
"&",
"0xFFFF",
";",
"if",
"(",
"value",
">",
"MAX_ENC_VALUE",
")",
"{",
"throw",
"new",
"SketchesArgumentException",
"(",
"... | Decodes the 16-bit reservoir size value into an int.
@param encodedSize Encoded 16-bit value
@return int represented by <tt>encodedSize</tt> | [
"Decodes",
"the",
"16",
"-",
"bit",
"reservoir",
"size",
"value",
"into",
"an",
"int",
"."
] | 900c8c9668a1e2f1d54d453e956caad54702e540 | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirSize.java#L95-L107 |
55,132 | mokies/ratelimitj | ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/concurrent/ConcurrentLimitRule.java | ConcurrentLimitRule.of | public static ConcurrentLimitRule of(int concurrentLimit, TimeUnit timeOutUnit, long timeOut) {
requireNonNull(timeOutUnit, "time out unit can not be null");
return new ConcurrentLimitRule(concurrentLimit, timeOutUnit.toMillis(timeOut));
} | java | public static ConcurrentLimitRule of(int concurrentLimit, TimeUnit timeOutUnit, long timeOut) {
requireNonNull(timeOutUnit, "time out unit can not be null");
return new ConcurrentLimitRule(concurrentLimit, timeOutUnit.toMillis(timeOut));
} | [
"public",
"static",
"ConcurrentLimitRule",
"of",
"(",
"int",
"concurrentLimit",
",",
"TimeUnit",
"timeOutUnit",
",",
"long",
"timeOut",
")",
"{",
"requireNonNull",
"(",
"timeOutUnit",
",",
"\"time out unit can not be null\"",
")",
";",
"return",
"new",
"ConcurrentLimi... | Initialise a concurrent rate limit.
@param concurrentLimit The concurrent limit.
@param timeOutUnit The time unit.
@param timeOut A timeOut for the checkout baton.
@return A concurrent limit rule. | [
"Initialise",
"a",
"concurrent",
"rate",
"limit",
"."
] | eb15ec42055c46b2b3f6f84131d86f570e489c32 | https://github.com/mokies/ratelimitj/blob/eb15ec42055c46b2b3f6f84131d86f570e489c32/ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/concurrent/ConcurrentLimitRule.java#L35-L38 |
55,133 | mokies/ratelimitj | ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java | RequestLimitRule.of | public static RequestLimitRule of(Duration duration, long limit) {
checkDuration(duration);
if (limit < 0) {
throw new IllegalArgumentException("limit must be greater than zero.");
}
int durationSeconds = (int) duration.getSeconds();
return new RequestLimitRule(durati... | java | public static RequestLimitRule of(Duration duration, long limit) {
checkDuration(duration);
if (limit < 0) {
throw new IllegalArgumentException("limit must be greater than zero.");
}
int durationSeconds = (int) duration.getSeconds();
return new RequestLimitRule(durati... | [
"public",
"static",
"RequestLimitRule",
"of",
"(",
"Duration",
"duration",
",",
"long",
"limit",
")",
"{",
"checkDuration",
"(",
"duration",
")",
";",
"if",
"(",
"limit",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"limit must be gre... | Initialise a request rate limit. Imagine the whole duration window as being one large bucket with a single count.
@param duration The time the limit will be applied over. The duration must be greater than 1 second.
@param limit A number representing the maximum operations that can be performed in the given duration... | [
"Initialise",
"a",
"request",
"rate",
"limit",
".",
"Imagine",
"the",
"whole",
"duration",
"window",
"as",
"being",
"one",
"large",
"bucket",
"with",
"a",
"single",
"count",
"."
] | eb15ec42055c46b2b3f6f84131d86f570e489c32 | https://github.com/mokies/ratelimitj/blob/eb15ec42055c46b2b3f6f84131d86f570e489c32/ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java#L55-L62 |
55,134 | mokies/ratelimitj | ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java | RequestLimitRule.withName | public RequestLimitRule withName(String name) {
return new RequestLimitRule(this.durationSeconds, this.limit, this.precision, name, this.keys);
} | java | public RequestLimitRule withName(String name) {
return new RequestLimitRule(this.durationSeconds, this.limit, this.precision, name, this.keys);
} | [
"public",
"RequestLimitRule",
"withName",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"RequestLimitRule",
"(",
"this",
".",
"durationSeconds",
",",
"this",
".",
"limit",
",",
"this",
".",
"precision",
",",
"name",
",",
"this",
".",
"keys",
")",
";",
... | Applies a name to the rate limit that is useful for metrics.
@param name Defines a descriptive name for the rule limit.
@return a limit rule | [
"Applies",
"a",
"name",
"to",
"the",
"rate",
"limit",
"that",
"is",
"useful",
"for",
"metrics",
"."
] | eb15ec42055c46b2b3f6f84131d86f570e489c32 | https://github.com/mokies/ratelimitj/blob/eb15ec42055c46b2b3f6f84131d86f570e489c32/ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java#L81-L83 |
55,135 | mokies/ratelimitj | ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java | RequestLimitRule.matchingKeys | public RequestLimitRule matchingKeys(String... keys) {
Set<String> keySet = keys.length > 0 ? new HashSet<>(Arrays.asList(keys)) : null;
return matchingKeys(keySet);
} | java | public RequestLimitRule matchingKeys(String... keys) {
Set<String> keySet = keys.length > 0 ? new HashSet<>(Arrays.asList(keys)) : null;
return matchingKeys(keySet);
} | [
"public",
"RequestLimitRule",
"matchingKeys",
"(",
"String",
"...",
"keys",
")",
"{",
"Set",
"<",
"String",
">",
"keySet",
"=",
"keys",
".",
"length",
">",
"0",
"?",
"new",
"HashSet",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"keys",
")",
")",
":",
"n... | Applies a key to the rate limit that defines to which keys, the rule applies, empty for any unmatched key.
@param keys Defines a set of keys to which the rule applies.
@return a limit rule | [
"Applies",
"a",
"key",
"to",
"the",
"rate",
"limit",
"that",
"defines",
"to",
"which",
"keys",
"the",
"rule",
"applies",
"empty",
"for",
"any",
"unmatched",
"key",
"."
] | eb15ec42055c46b2b3f6f84131d86f570e489c32 | https://github.com/mokies/ratelimitj/blob/eb15ec42055c46b2b3f6f84131d86f570e489c32/ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java#L91-L94 |
55,136 | mokies/ratelimitj | ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java | RequestLimitRule.matchingKeys | public RequestLimitRule matchingKeys(Set<String> keys) {
return new RequestLimitRule(this.durationSeconds, this.limit, this.precision, this.name, keys);
} | java | public RequestLimitRule matchingKeys(Set<String> keys) {
return new RequestLimitRule(this.durationSeconds, this.limit, this.precision, this.name, keys);
} | [
"public",
"RequestLimitRule",
"matchingKeys",
"(",
"Set",
"<",
"String",
">",
"keys",
")",
"{",
"return",
"new",
"RequestLimitRule",
"(",
"this",
".",
"durationSeconds",
",",
"this",
".",
"limit",
",",
"this",
".",
"precision",
",",
"this",
".",
"name",
",... | Applies a key to the rate limit that defines to which keys, the rule applies, null for any unmatched key.
@param keys Defines a set of keys to which the rule applies.
@return a limit rule | [
"Applies",
"a",
"key",
"to",
"the",
"rate",
"limit",
"that",
"defines",
"to",
"which",
"keys",
"the",
"rule",
"applies",
"null",
"for",
"any",
"unmatched",
"key",
"."
] | eb15ec42055c46b2b3f6f84131d86f570e489c32 | https://github.com/mokies/ratelimitj/blob/eb15ec42055c46b2b3f6f84131d86f570e489c32/ratelimitj-core/src/main/java/es/moki/ratelimitj/core/limiter/request/RequestLimitRule.java#L102-L104 |
55,137 | Netflix/governator | governator-core/src/main/java/com/netflix/governator/internal/PreDestroyMonitor.java | PreDestroyMonitor.addScopeBindings | public void addScopeBindings(Map<Class<? extends Annotation>, Scope> bindings) {
if (scopeCleaner.isRunning()) {
scopeBindings.putAll(bindings);
}
} | java | public void addScopeBindings(Map<Class<? extends Annotation>, Scope> bindings) {
if (scopeCleaner.isRunning()) {
scopeBindings.putAll(bindings);
}
} | [
"public",
"void",
"addScopeBindings",
"(",
"Map",
"<",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
",",
"Scope",
">",
"bindings",
")",
"{",
"if",
"(",
"scopeCleaner",
".",
"isRunning",
"(",
")",
")",
"{",
"scopeBindings",
".",
"putAll",
"(",
"bindin... | allows late-binding of scopes to PreDestroyMonitor, useful if more than one
Injector contributes scope bindings
@param bindings additional annotation-to-scope bindings to add | [
"allows",
"late",
"-",
"binding",
"of",
"scopes",
"to",
"PreDestroyMonitor",
"useful",
"if",
"more",
"than",
"one",
"Injector",
"contributes",
"scope",
"bindings"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/internal/PreDestroyMonitor.java#L181-L185 |
55,138 | Netflix/governator | governator-core/src/main/java/com/netflix/governator/internal/PreDestroyMonitor.java | PreDestroyMonitor.close | @Override
public void close() throws Exception {
if (scopeCleaner.close()) { // executor thread to exit processing loop
LOGGER.info("closing PreDestroyMonitor...");
List<Map.Entry<Object, UnscopedCleanupAction>> actions = new ArrayList<>(cleanupActions.entrySet());
... | java | @Override
public void close() throws Exception {
if (scopeCleaner.close()) { // executor thread to exit processing loop
LOGGER.info("closing PreDestroyMonitor...");
List<Map.Entry<Object, UnscopedCleanupAction>> actions = new ArrayList<>(cleanupActions.entrySet());
... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"scopeCleaner",
".",
"close",
"(",
")",
")",
"{",
"// executor thread to exit processing loop ",
"LOGGER",
".",
"info",
"(",
"\"closing PreDestroyMonitor...\"",
"... | final cleanup of managed instances if any | [
"final",
"cleanup",
"of",
"managed",
"instances",
"if",
"any"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/internal/PreDestroyMonitor.java#L190-L212 |
55,139 | Netflix/governator | governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java | InjectorBuilder.combineWith | public InjectorBuilder combineWith(Module ... modules) {
List<Module> m = new ArrayList<>();
m.add(module);
m.addAll(Arrays.asList(modules));
this.module = Modules.combine(m);
return this;
} | java | public InjectorBuilder combineWith(Module ... modules) {
List<Module> m = new ArrayList<>();
m.add(module);
m.addAll(Arrays.asList(modules));
this.module = Modules.combine(m);
return this;
} | [
"public",
"InjectorBuilder",
"combineWith",
"(",
"Module",
"...",
"modules",
")",
"{",
"List",
"<",
"Module",
">",
"m",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"m",
".",
"add",
"(",
"module",
")",
";",
"m",
".",
"addAll",
"(",
"Arrays",
".",
... | Add additional bindings to the module tracked by the DSL
@param modules | [
"Add",
"additional",
"bindings",
"to",
"the",
"module",
"tracked",
"by",
"the",
"DSL"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java#L96-L102 |
55,140 | Netflix/governator | governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java | InjectorBuilder.forEachElement | public <T> InjectorBuilder forEachElement(ElementVisitor<T> visitor, Consumer<T> consumer) {
Elements
.getElements(module)
.forEach(element -> Optional.ofNullable(element.acceptVisitor(visitor)).ifPresent(consumer));
return this;
} | java | public <T> InjectorBuilder forEachElement(ElementVisitor<T> visitor, Consumer<T> consumer) {
Elements
.getElements(module)
.forEach(element -> Optional.ofNullable(element.acceptVisitor(visitor)).ifPresent(consumer));
return this;
} | [
"public",
"<",
"T",
">",
"InjectorBuilder",
"forEachElement",
"(",
"ElementVisitor",
"<",
"T",
">",
"visitor",
",",
"Consumer",
"<",
"T",
">",
"consumer",
")",
"{",
"Elements",
".",
"getElements",
"(",
"module",
")",
".",
"forEach",
"(",
"element",
"->",
... | Iterate through all elements of the current module and pass the output of the
ElementVisitor to the provided consumer. 'null' responses from the visitor are ignored.
This call will not modify any bindings
@param visitor | [
"Iterate",
"through",
"all",
"elements",
"of",
"the",
"current",
"module",
"and",
"pass",
"the",
"output",
"of",
"the",
"ElementVisitor",
"to",
"the",
"provided",
"consumer",
".",
"null",
"responses",
"from",
"the",
"visitor",
"are",
"ignored",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java#L123-L128 |
55,141 | Netflix/governator | governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java | InjectorBuilder.forEachElement | public <T> InjectorBuilder forEachElement(ElementVisitor<T> visitor) {
Elements
.getElements(module)
.forEach(element -> element.acceptVisitor(visitor));
return this;
} | java | public <T> InjectorBuilder forEachElement(ElementVisitor<T> visitor) {
Elements
.getElements(module)
.forEach(element -> element.acceptVisitor(visitor));
return this;
} | [
"public",
"<",
"T",
">",
"InjectorBuilder",
"forEachElement",
"(",
"ElementVisitor",
"<",
"T",
">",
"visitor",
")",
"{",
"Elements",
".",
"getElements",
"(",
"module",
")",
".",
"forEach",
"(",
"element",
"->",
"element",
".",
"acceptVisitor",
"(",
"visitor"... | Call the provided visitor for all elements of the current module.
This call will not modify any bindings
@param visitor | [
"Call",
"the",
"provided",
"visitor",
"for",
"all",
"elements",
"of",
"the",
"current",
"module",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java#L136-L141 |
55,142 | Netflix/governator | governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java | InjectorBuilder.filter | public InjectorBuilder filter(ElementVisitor<Boolean> predicate) {
List<Element> elements = new ArrayList<Element>();
for (Element element : Elements.getElements(Stage.TOOL, module)) {
if (element.acceptVisitor(predicate)) {
elements.add(element);
}
}
... | java | public InjectorBuilder filter(ElementVisitor<Boolean> predicate) {
List<Element> elements = new ArrayList<Element>();
for (Element element : Elements.getElements(Stage.TOOL, module)) {
if (element.acceptVisitor(predicate)) {
elements.add(element);
}
}
... | [
"public",
"InjectorBuilder",
"filter",
"(",
"ElementVisitor",
"<",
"Boolean",
">",
"predicate",
")",
"{",
"List",
"<",
"Element",
">",
"elements",
"=",
"new",
"ArrayList",
"<",
"Element",
">",
"(",
")",
";",
"for",
"(",
"Element",
"element",
":",
"Elements... | Filter out elements for which the provided visitor returns true.
@param predicate | [
"Filter",
"out",
"elements",
"for",
"which",
"the",
"provided",
"visitor",
"returns",
"true",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/InjectorBuilder.java#L173-L182 |
55,143 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/guice/ModulesEx.java | ModulesEx.combineAndOverride | public static Module combineAndOverride(List<? extends Module> modules) {
Iterator<? extends Module> iter = modules.iterator();
Module current = Modules.EMPTY_MODULE;
if (iter.hasNext()) {
current = iter.next();
if (iter.hasNext()) {
current = Modules.over... | java | public static Module combineAndOverride(List<? extends Module> modules) {
Iterator<? extends Module> iter = modules.iterator();
Module current = Modules.EMPTY_MODULE;
if (iter.hasNext()) {
current = iter.next();
if (iter.hasNext()) {
current = Modules.over... | [
"public",
"static",
"Module",
"combineAndOverride",
"(",
"List",
"<",
"?",
"extends",
"Module",
">",
"modules",
")",
"{",
"Iterator",
"<",
"?",
"extends",
"Module",
">",
"iter",
"=",
"modules",
".",
"iterator",
"(",
")",
";",
"Module",
"current",
"=",
"M... | Generate a single module that is produced by accumulating and overriding
each module with the next.
<pre>
{@code
Guice.createInjector(ModuleUtils.combineAndOverride(moduleA, moduleAOverrides, moduleB));
}
</pre>
@param modules
@return | [
"Generate",
"a",
"single",
"module",
"that",
"is",
"produced",
"by",
"accumulating",
"and",
"overriding",
"each",
"module",
"with",
"the",
"next",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/ModulesEx.java#L43-L54 |
55,144 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/guice/ModulesEx.java | ModulesEx.fromClass | public static Module fromClass(final Class<?> cls, final boolean override) {
List<Module> modules = new ArrayList<>();
// Iterate through all annotations of the main class, create a binding for the annotation
// and add the module to the list of modules to install
for (final Annotation a... | java | public static Module fromClass(final Class<?> cls, final boolean override) {
List<Module> modules = new ArrayList<>();
// Iterate through all annotations of the main class, create a binding for the annotation
// and add the module to the list of modules to install
for (final Annotation a... | [
"public",
"static",
"Module",
"fromClass",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"boolean",
"override",
")",
"{",
"List",
"<",
"Module",
">",
"modules",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Iterate through all annotations of... | Create a single module that derived from all bootstrap annotations
on a class, where that class itself is a module.
For example,
<pre>
{@code
public class MainApplicationModule extends AbstractModule {
@Override
public void configure() {
// Application specific bindings here
}
public static void main(String[] args) {... | [
"Create",
"a",
"single",
"module",
"that",
"derived",
"from",
"all",
"bootstrap",
"annotations",
"on",
"a",
"class",
"where",
"that",
"class",
"itself",
"is",
"a",
"module",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/ModulesEx.java#L81-L109 |
55,145 | Netflix/governator | governator-core/src/main/java/com/netflix/governator/Governator.java | Governator.setFeature | public <T> Governator setFeature(GovernatorFeature<T> feature, T value) {
this.featureOverrides.put(feature, value);
return this;
} | java | public <T> Governator setFeature(GovernatorFeature<T> feature, T value) {
this.featureOverrides.put(feature, value);
return this;
} | [
"public",
"<",
"T",
">",
"Governator",
"setFeature",
"(",
"GovernatorFeature",
"<",
"T",
">",
"feature",
",",
"T",
"value",
")",
"{",
"this",
".",
"featureOverrides",
".",
"put",
"(",
"feature",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Set a feature
@param feature Feature to set
@return this | [
"Set",
"a",
"feature"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/Governator.java#L190-L193 |
55,146 | Netflix/governator | governator-core/src/main/java/com/netflix/governator/Governator.java | Governator.run | private LifecycleInjector run(Module externalModule, final String[] args) {
return InjectorBuilder
.fromModules(modules)
.combineWith(externalModule)
.map(new ModuleTransformer() {
@Override
public Module transform(Module module) {
... | java | private LifecycleInjector run(Module externalModule, final String[] args) {
return InjectorBuilder
.fromModules(modules)
.combineWith(externalModule)
.map(new ModuleTransformer() {
@Override
public Module transform(Module module) {
... | [
"private",
"LifecycleInjector",
"run",
"(",
"Module",
"externalModule",
",",
"final",
"String",
"[",
"]",
"args",
")",
"{",
"return",
"InjectorBuilder",
".",
"fromModules",
"(",
"modules",
")",
".",
"combineWith",
"(",
"externalModule",
")",
".",
"map",
"(",
... | Create the injector and call any LifecycleListeners
@param args - Runtime parameter (from main) injectable as {@literal @}Arguments String[]
@return the LifecycleInjector for this run | [
"Create",
"the",
"injector",
"and",
"call",
"any",
"LifecycleListeners"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-core/src/main/java/com/netflix/governator/Governator.java#L288-L308 |
55,147 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/guice/Grapher.java | Grapher.toFile | public String toFile() throws Exception {
File file = File.createTempFile("GuiceDependencies_", ".dot");
toFile(file);
return file.getCanonicalPath();
} | java | public String toFile() throws Exception {
File file = File.createTempFile("GuiceDependencies_", ".dot");
toFile(file);
return file.getCanonicalPath();
} | [
"public",
"String",
"toFile",
"(",
")",
"throws",
"Exception",
"{",
"File",
"file",
"=",
"File",
".",
"createTempFile",
"(",
"\"GuiceDependencies_\"",
",",
"\".dot\"",
")",
";",
"toFile",
"(",
"file",
")",
";",
"return",
"file",
".",
"getCanonicalPath",
"(",... | Writes the "Dot" graph to a new temp file.
@return the name of the newly created file | [
"Writes",
"the",
"Dot",
"graph",
"to",
"a",
"new",
"temp",
"file",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/Grapher.java#L120-L124 |
55,148 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/guice/Grapher.java | Grapher.toFile | public void toFile(File file) throws Exception {
PrintWriter out = new PrintWriter(file, "UTF-8");
try {
out.write(graph());
}
finally {
Closeables.close(out, true);
}
} | java | public void toFile(File file) throws Exception {
PrintWriter out = new PrintWriter(file, "UTF-8");
try {
out.write(graph());
}
finally {
Closeables.close(out, true);
}
} | [
"public",
"void",
"toFile",
"(",
"File",
"file",
")",
"throws",
"Exception",
"{",
"PrintWriter",
"out",
"=",
"new",
"PrintWriter",
"(",
"file",
",",
"\"UTF-8\"",
")",
";",
"try",
"{",
"out",
".",
"write",
"(",
"graph",
"(",
")",
")",
";",
"}",
"final... | Writes the "Dot" graph to a given file.
@param file file to write to | [
"Writes",
"the",
"Dot",
"graph",
"to",
"a",
"given",
"file",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/Grapher.java#L131-L139 |
55,149 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/guice/Grapher.java | Grapher.graph | public String graph() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter out = new PrintWriter(baos);
Injector localInjector = Guice.createInjector(new GraphvizModule());
GraphvizGrapher renderer = localInjector.getInstance(GraphvizGrapher.class);
... | java | public String graph() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintWriter out = new PrintWriter(baos);
Injector localInjector = Guice.createInjector(new GraphvizModule());
GraphvizGrapher renderer = localInjector.getInstance(GraphvizGrapher.class);
... | [
"public",
"String",
"graph",
"(",
")",
"throws",
"Exception",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"PrintWriter",
"out",
"=",
"new",
"PrintWriter",
"(",
"baos",
")",
";",
"Injector",
"localInjector",
"=",
"G... | Returns a String containing the "Dot" graph definition.
@return the "Dot" graph definition | [
"Returns",
"a",
"String",
"containing",
"the",
"Dot",
"graph",
"definition",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/Grapher.java#L146-L158 |
55,150 | Netflix/governator | governator-jersey/src/main/java/com/netflix/governator/guice/jersey/GovernatorComponentProviderFactory.java | GovernatorComponentProviderFactory.isGuiceConstructorInjected | public boolean isGuiceConstructorInjected(Class<?> c) {
for (Constructor<?> con : c.getDeclaredConstructors()) {
if (isInjectable(con)) {
return true;
}
}
return false;
} | java | public boolean isGuiceConstructorInjected(Class<?> c) {
for (Constructor<?> con : c.getDeclaredConstructors()) {
if (isInjectable(con)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"isGuiceConstructorInjected",
"(",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"for",
"(",
"Constructor",
"<",
"?",
">",
"con",
":",
"c",
".",
"getDeclaredConstructors",
"(",
")",
")",
"{",
"if",
"(",
"isInjectable",
"(",
"con",
")",
")... | Determine if a class is an implicit Guice component that can be
instantiated by Guice and the life-cycle managed by Jersey.
@param c the class.
@return true if the class is an implicit Guice component. | [
"Determine",
"if",
"a",
"class",
"is",
"an",
"implicit",
"Guice",
"component",
"that",
"can",
"be",
"instantiated",
"by",
"Guice",
"and",
"the",
"life",
"-",
"cycle",
"managed",
"by",
"Jersey",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-jersey/src/main/java/com/netflix/governator/guice/jersey/GovernatorComponentProviderFactory.java#L163-L171 |
55,151 | Netflix/governator | governator-jersey/src/main/java/com/netflix/governator/guice/jersey/GovernatorComponentProviderFactory.java | GovernatorComponentProviderFactory.createScopeMap | public Map<Scope, ComponentScope> createScopeMap() {
Map<Scope, ComponentScope> result = new HashMap<Scope, ComponentScope>();
result.put(Scopes.SINGLETON, ComponentScope.Singleton);
result.put(Scopes.NO_SCOPE, ComponentScope.PerRequest);
result.put(ServletScopes.REQUEST, ComponentScope.... | java | public Map<Scope, ComponentScope> createScopeMap() {
Map<Scope, ComponentScope> result = new HashMap<Scope, ComponentScope>();
result.put(Scopes.SINGLETON, ComponentScope.Singleton);
result.put(Scopes.NO_SCOPE, ComponentScope.PerRequest);
result.put(ServletScopes.REQUEST, ComponentScope.... | [
"public",
"Map",
"<",
"Scope",
",",
"ComponentScope",
">",
"createScopeMap",
"(",
")",
"{",
"Map",
"<",
"Scope",
",",
"ComponentScope",
">",
"result",
"=",
"new",
"HashMap",
"<",
"Scope",
",",
"ComponentScope",
">",
"(",
")",
";",
"result",
".",
"put",
... | Maps a Guice scope to a Jersey scope.
@return the map | [
"Maps",
"a",
"Guice",
"scope",
"to",
"a",
"Jersey",
"scope",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-jersey/src/main/java/com/netflix/governator/guice/jersey/GovernatorComponentProviderFactory.java#L206-L212 |
55,152 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java | ColumnPrinter.addColumn | void addColumn(String columnName)
{
data.add(new ArrayList<String>());
columnNames.add(columnName);
} | java | void addColumn(String columnName)
{
data.add(new ArrayList<String>());
columnNames.add(columnName);
} | [
"void",
"addColumn",
"(",
"String",
"columnName",
")",
"{",
"data",
".",
"add",
"(",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
")",
";",
"columnNames",
".",
"add",
"(",
"columnName",
")",
";",
"}"
] | Add a column
@param columnName name of the column | [
"Add",
"a",
"column"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java#L48-L52 |
55,153 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java | ColumnPrinter.addValue | void addValue(String columnName, String value)
{
addValue(columnNames.indexOf(columnName), value);
} | java | void addValue(String columnName, String value)
{
addValue(columnNames.indexOf(columnName), value);
} | [
"void",
"addValue",
"(",
"String",
"columnName",
",",
"String",
"value",
")",
"{",
"addValue",
"(",
"columnNames",
".",
"indexOf",
"(",
"columnName",
")",
",",
"value",
")",
";",
"}"
] | Add a value to the first column with the given name
@param columnName name of the column to add to
@param value value to add | [
"Add",
"a",
"value",
"to",
"the",
"first",
"column",
"with",
"the",
"given",
"name"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java#L60-L63 |
55,154 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java | ColumnPrinter.addValue | void addValue(int columnIndex, String value)
{
if ( (columnIndex < 0) || (columnIndex >= data.size()) )
{
throw new IllegalArgumentException();
}
List<String> stringList = data.get(columnIndex);
stringList.add(value);
} | java | void addValue(int columnIndex, String value)
{
if ( (columnIndex < 0) || (columnIndex >= data.size()) )
{
throw new IllegalArgumentException();
}
List<String> stringList = data.get(columnIndex);
stringList.add(value);
} | [
"void",
"addValue",
"(",
"int",
"columnIndex",
",",
"String",
"value",
")",
"{",
"if",
"(",
"(",
"columnIndex",
"<",
"0",
")",
"||",
"(",
"columnIndex",
">=",
"data",
".",
"size",
"(",
")",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"("... | Add a value to the nth column
@param columnIndex n
@param value value to add | [
"Add",
"a",
"value",
"to",
"the",
"nth",
"column"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java#L71-L80 |
55,155 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java | ColumnPrinter.generate | List<String> generate()
{
List<String> lines = Lists.newArrayList();
StringBuilder workStr = new StringBuilder();
List<AtomicInteger> columnWidths = getColumnWidths();
List<Iterator<String>> dataIterators = getDataIterators();
Iterator<AtomicInteger> columnWidthIterator = c... | java | List<String> generate()
{
List<String> lines = Lists.newArrayList();
StringBuilder workStr = new StringBuilder();
List<AtomicInteger> columnWidths = getColumnWidths();
List<Iterator<String>> dataIterators = getDataIterators();
Iterator<AtomicInteger> columnWidthIterator = c... | [
"List",
"<",
"String",
">",
"generate",
"(",
")",
"{",
"List",
"<",
"String",
">",
"lines",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"StringBuilder",
"workStr",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"List",
"<",
"AtomicInteger",
">",
"co... | Generate the output as a list of string lines
@return lines | [
"Generate",
"the",
"output",
"as",
"a",
"list",
"of",
"string",
"lines"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ColumnPrinter.java#L110-L155 |
55,156 | Netflix/governator | governator-commons-cli/src/main/java/com/netflix/governator/commons_cli/Cli.java | Cli.start | public static void start(Class<?> mainClass, final String[] args) {
try {
LifecycleInjector.bootstrap(mainClass, new AbstractModule() {
@Override
protected void configure() {
bind(String[].class).annotatedWith(Main.class).toInstance(args);
... | java | public static void start(Class<?> mainClass, final String[] args) {
try {
LifecycleInjector.bootstrap(mainClass, new AbstractModule() {
@Override
protected void configure() {
bind(String[].class).annotatedWith(Main.class).toInstance(args);
... | [
"public",
"static",
"void",
"start",
"(",
"Class",
"<",
"?",
">",
"mainClass",
",",
"final",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"LifecycleInjector",
".",
"bootstrap",
"(",
"mainClass",
",",
"new",
"AbstractModule",
"(",
")",
"{",
"@",
"O... | Utility method to start the CommonsCli using a main class and command line arguments
@param mainClass
@param args | [
"Utility",
"method",
"to",
"start",
"the",
"CommonsCli",
"using",
"a",
"main",
"class",
"and",
"command",
"line",
"arguments"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-commons-cli/src/main/java/com/netflix/governator/commons_cli/Cli.java#L15-L26 |
55,157 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java | ConfigurationColumnWriter.output | public void output(Logger log)
{
Map<String, Entry> entries = config.getSortedEntries();
if ( entries.isEmpty() )
{
return;
}
ColumnPrinter printer = build(entries);
log.debug("Configuration Details");
for ( String line : printer.generat... | java | public void output(Logger log)
{
Map<String, Entry> entries = config.getSortedEntries();
if ( entries.isEmpty() )
{
return;
}
ColumnPrinter printer = build(entries);
log.debug("Configuration Details");
for ( String line : printer.generat... | [
"public",
"void",
"output",
"(",
"Logger",
"log",
")",
"{",
"Map",
"<",
"String",
",",
"Entry",
">",
"entries",
"=",
"config",
".",
"getSortedEntries",
"(",
")",
";",
"if",
"(",
"entries",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"Co... | Write the documentation table to a logger
@param log | [
"Write",
"the",
"documentation",
"table",
"to",
"a",
"logger"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java#L30-L46 |
55,158 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java | ConfigurationColumnWriter.output | public void output(PrintWriter out)
{
Map<String, Entry> entries = config.getSortedEntries();
if ( entries.isEmpty() )
{
return;
}
ColumnPrinter printer = build(entries);
out.println("Configuration Details");
printer.print(out);
} | java | public void output(PrintWriter out)
{
Map<String, Entry> entries = config.getSortedEntries();
if ( entries.isEmpty() )
{
return;
}
ColumnPrinter printer = build(entries);
out.println("Configuration Details");
printer.print(out);
} | [
"public",
"void",
"output",
"(",
"PrintWriter",
"out",
")",
"{",
"Map",
"<",
"String",
",",
"Entry",
">",
"entries",
"=",
"config",
".",
"getSortedEntries",
"(",
")",
";",
"if",
"(",
"entries",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
... | Output documentation table to a PrintWriter
@param out | [
"Output",
"documentation",
"table",
"to",
"a",
"PrintWriter"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java#L61-L74 |
55,159 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java | ConfigurationColumnWriter.build | private ColumnPrinter build(Map<String, Entry> entries)
{
ColumnPrinter printer = new ColumnPrinter();
printer.addColumn("PROPERTY");
printer.addColumn("FIELD");
printer.addColumn("DEFAULT");
printer.addColumn("VALUE");
printer.addColumn("DESCRIPTION");
Map<... | java | private ColumnPrinter build(Map<String, Entry> entries)
{
ColumnPrinter printer = new ColumnPrinter();
printer.addColumn("PROPERTY");
printer.addColumn("FIELD");
printer.addColumn("DEFAULT");
printer.addColumn("VALUE");
printer.addColumn("DESCRIPTION");
Map<... | [
"private",
"ColumnPrinter",
"build",
"(",
"Map",
"<",
"String",
",",
"Entry",
">",
"entries",
")",
"{",
"ColumnPrinter",
"printer",
"=",
"new",
"ColumnPrinter",
"(",
")",
";",
"printer",
".",
"addColumn",
"(",
"\"PROPERTY\"",
")",
";",
"printer",
".",
"add... | Construct a ColumnPrinter using the entries
@param entries
@return | [
"Construct",
"a",
"ColumnPrinter",
"using",
"the",
"entries"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationColumnWriter.java#L82-L104 |
55,160 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/KeyParser.java | KeyParser.parse | public static List<ConfigurationKeyPart> parse(String raw, Map<String, String> contextOverrides)
{
List<ConfigurationKeyPart> parts = Lists.newArrayList();
int caret = 0;
for (; ; )
{
int startIndex = raw.indexOf("${", caret);
if ( startIndex < 0 )
... | java | public static List<ConfigurationKeyPart> parse(String raw, Map<String, String> contextOverrides)
{
List<ConfigurationKeyPart> parts = Lists.newArrayList();
int caret = 0;
for (; ; )
{
int startIndex = raw.indexOf("${", caret);
if ( startIndex < 0 )
... | [
"public",
"static",
"List",
"<",
"ConfigurationKeyPart",
">",
"parse",
"(",
"String",
"raw",
",",
"Map",
"<",
"String",
",",
"String",
">",
"contextOverrides",
")",
"{",
"List",
"<",
"ConfigurationKeyPart",
">",
"parts",
"=",
"Lists",
".",
"newArrayList",
"(... | Parse a key into parts
@param raw the key
@return parts | [
"Parse",
"a",
"key",
"into",
"parts"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/KeyParser.java#L35-L82 |
55,161 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/lifecycle/LifecycleManager.java | LifecycleManager.add | @Deprecated
public void add(Object... objects) throws Exception
{
for ( Object obj : objects )
{
add(obj);
}
} | java | @Deprecated
public void add(Object... objects) throws Exception
{
for ( Object obj : objects )
{
add(obj);
}
} | [
"@",
"Deprecated",
"public",
"void",
"add",
"(",
"Object",
"...",
"objects",
")",
"throws",
"Exception",
"{",
"for",
"(",
"Object",
"obj",
":",
"objects",
")",
"{",
"add",
"(",
"obj",
")",
";",
"}",
"}"
] | Add the objects to the container. Their assets will be loaded, post construct methods called, etc.
@param objects objects to add
@throws Exception errors | [
"Add",
"the",
"objects",
"to",
"the",
"container",
".",
"Their",
"assets",
"will",
"be",
"loaded",
"post",
"construct",
"methods",
"called",
"etc",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/lifecycle/LifecycleManager.java#L128-L135 |
55,162 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/lifecycle/LifecycleManager.java | LifecycleManager.add | @Deprecated
public void add(Object obj) throws Exception
{
add(obj, null, new LifecycleMethods(obj.getClass()));
} | java | @Deprecated
public void add(Object obj) throws Exception
{
add(obj, null, new LifecycleMethods(obj.getClass()));
} | [
"@",
"Deprecated",
"public",
"void",
"add",
"(",
"Object",
"obj",
")",
"throws",
"Exception",
"{",
"add",
"(",
"obj",
",",
"null",
",",
"new",
"LifecycleMethods",
"(",
"obj",
".",
"getClass",
"(",
")",
")",
")",
";",
"}"
] | Add the object to the container. Its assets will be loaded, post construct methods called, etc.
@param obj object to add
@throws Exception errors | [
"Add",
"the",
"object",
"to",
"the",
"container",
".",
"Its",
"assets",
"will",
"be",
"loaded",
"post",
"construct",
"methods",
"called",
"etc",
"."
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/lifecycle/LifecycleManager.java#L143-L147 |
55,163 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/lifecycle/LifecycleManager.java | LifecycleManager.getState | public LifecycleState getState(Object obj)
{
LifecycleStateWrapper lifecycleState = objectStates.get(obj);
if ( lifecycleState == null )
{
return hasStarted() ? LifecycleState.ACTIVE : LifecycleState.LATENT;
}
else {
synchronized(lifecycleState) {
... | java | public LifecycleState getState(Object obj)
{
LifecycleStateWrapper lifecycleState = objectStates.get(obj);
if ( lifecycleState == null )
{
return hasStarted() ? LifecycleState.ACTIVE : LifecycleState.LATENT;
}
else {
synchronized(lifecycleState) {
... | [
"public",
"LifecycleState",
"getState",
"(",
"Object",
"obj",
")",
"{",
"LifecycleStateWrapper",
"lifecycleState",
"=",
"objectStates",
".",
"get",
"(",
"obj",
")",
";",
"if",
"(",
"lifecycleState",
"==",
"null",
")",
"{",
"return",
"hasStarted",
"(",
")",
"... | Return the current state of the given object or LATENT if unknown
@param obj object to check
@return state | [
"Return",
"the",
"current",
"state",
"of",
"the",
"given",
"object",
"or",
"LATENT",
"if",
"unknown"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/lifecycle/LifecycleManager.java#L203-L215 |
55,164 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationKey.java | ConfigurationKey.getKey | public String getKey(Map<String, String> variableValues)
{
StringBuilder key = new StringBuilder();
for ( ConfigurationKeyPart p : parts )
{
if ( p.isVariable() )
{
String value = variableValues.get(p.getValue());
if ( value == null )
... | java | public String getKey(Map<String, String> variableValues)
{
StringBuilder key = new StringBuilder();
for ( ConfigurationKeyPart p : parts )
{
if ( p.isVariable() )
{
String value = variableValues.get(p.getValue());
if ( value == null )
... | [
"public",
"String",
"getKey",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"variableValues",
")",
"{",
"StringBuilder",
"key",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"ConfigurationKeyPart",
"p",
":",
"parts",
")",
"{",
"if",
"(",
"p",
... | Return the final key applying variables as needed
@param variableValues map of variable names to values
@return the key | [
"Return",
"the",
"final",
"key",
"applying",
"variables",
"as",
"needed"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationKey.java#L60-L82 |
55,165 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationKey.java | ConfigurationKey.getVariableNames | public Collection<String> getVariableNames()
{
ImmutableSet.Builder<String> builder = ImmutableSet.builder();
for ( ConfigurationKeyPart p : parts )
{
if ( p.isVariable() )
{
builder.add(p.getValue());
}
}
return builder.bu... | java | public Collection<String> getVariableNames()
{
ImmutableSet.Builder<String> builder = ImmutableSet.builder();
for ( ConfigurationKeyPart p : parts )
{
if ( p.isVariable() )
{
builder.add(p.getValue());
}
}
return builder.bu... | [
"public",
"Collection",
"<",
"String",
">",
"getVariableNames",
"(",
")",
"{",
"ImmutableSet",
".",
"Builder",
"<",
"String",
">",
"builder",
"=",
"ImmutableSet",
".",
"builder",
"(",
")",
";",
"for",
"(",
"ConfigurationKeyPart",
"p",
":",
"parts",
")",
"{... | Return the names of the variables specified in the key if any
@return names (might be zero sized) | [
"Return",
"the",
"names",
"of",
"the",
"variables",
"specified",
"in",
"the",
"key",
"if",
"any"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/configuration/ConfigurationKey.java#L97-L109 |
55,166 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/guice/LifecycleInjector.java | LifecycleInjector.createChildInjector | public Injector createChildInjector(Collection<Module> modules)
{
Injector childInjector;
Collection<Module> localModules = modules;
for (ModuleTransformer transformer : transformers) {
localModules = transformer.call(localModules);
}
//noinspection depr... | java | public Injector createChildInjector(Collection<Module> modules)
{
Injector childInjector;
Collection<Module> localModules = modules;
for (ModuleTransformer transformer : transformers) {
localModules = transformer.call(localModules);
}
//noinspection depr... | [
"public",
"Injector",
"createChildInjector",
"(",
"Collection",
"<",
"Module",
">",
"modules",
")",
"{",
"Injector",
"childInjector",
";",
"Collection",
"<",
"Module",
">",
"localModules",
"=",
"modules",
";",
"for",
"(",
"ModuleTransformer",
"transformer",
":",
... | Create an injector that is a child of the bootstrap bindings only
@param modules binding modules
@return injector | [
"Create",
"an",
"injector",
"that",
"is",
"a",
"child",
"of",
"the",
"bootstrap",
"bindings",
"only"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/LifecycleInjector.java#L320-L343 |
55,167 | Netflix/governator | governator-legacy/src/main/java/com/netflix/governator/guice/LifecycleInjector.java | LifecycleInjector.createInjector | public Injector createInjector(Collection<Module> additionalModules)
{
List<Module> localModules = Lists.newArrayList();
// Add the discovered modules FIRST. The discovered modules
// are added, and will subsequently be configured, in module dependency
// order which will ... | java | public Injector createInjector(Collection<Module> additionalModules)
{
List<Module> localModules = Lists.newArrayList();
// Add the discovered modules FIRST. The discovered modules
// are added, and will subsequently be configured, in module dependency
// order which will ... | [
"public",
"Injector",
"createInjector",
"(",
"Collection",
"<",
"Module",
">",
"additionalModules",
")",
"{",
"List",
"<",
"Module",
">",
"localModules",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"// Add the discovered modules FIRST. The discovered modules",
... | Create the main injector
@param additionalModules any additional modules
@return injector | [
"Create",
"the",
"main",
"injector"
] | c1f4bb1518e759c61f2e9cad8a896ec6beba0294 | https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/LifecycleInjector.java#L372-L412 |
55,168 | Netflix/ndbench | ndbench-core/src/main/java/com/netflix/ndbench/core/NdBenchDriver.java | NdBenchDriver.stop | public void stop() {
stopWrites();
stopReads();
if (timerRef != null && timerRef.get() != null) {
timerRef.get().shutdownNow();
timerRef.set(null);
}
ndBenchMonitor.resetStats();
} | java | public void stop() {
stopWrites();
stopReads();
if (timerRef != null && timerRef.get() != null) {
timerRef.get().shutdownNow();
timerRef.set(null);
}
ndBenchMonitor.resetStats();
} | [
"public",
"void",
"stop",
"(",
")",
"{",
"stopWrites",
"(",
")",
";",
"stopReads",
"(",
")",
";",
"if",
"(",
"timerRef",
"!=",
"null",
"&&",
"timerRef",
".",
"get",
"(",
")",
"!=",
"null",
")",
"{",
"timerRef",
".",
"get",
"(",
")",
".",
"shutdow... | FUNCTIONALITY FOR STOPPING THE WORKERS | [
"FUNCTIONALITY",
"FOR",
"STOPPING",
"THE",
"WORKERS"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-core/src/main/java/com/netflix/ndbench/core/NdBenchDriver.java#L282-L290 |
55,169 | Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.nonPipelineRead | public String nonPipelineRead(String key) throws Exception {
String res = jedisClient.get().get(key);
if (res != null) {
if (res.isEmpty()) {
throw new Exception("Data retrieved is not ok ");
}
} else {
return CacheMiss;
}
re... | java | public String nonPipelineRead(String key) throws Exception {
String res = jedisClient.get().get(key);
if (res != null) {
if (res.isEmpty()) {
throw new Exception("Data retrieved is not ok ");
}
} else {
return CacheMiss;
}
re... | [
"public",
"String",
"nonPipelineRead",
"(",
"String",
"key",
")",
"throws",
"Exception",
"{",
"String",
"res",
"=",
"jedisClient",
".",
"get",
"(",
")",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"res",
"!=",
"null",
")",
"{",
"if",
"(",
"res",
"... | This is the non pipelined version of the reads
@param key
@return the value of the corresponding key
@throws Exception | [
"This",
"is",
"the",
"non",
"pipelined",
"version",
"of",
"the",
"reads"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L49-L63 |
55,170 | Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.pipelineRead | public String pipelineRead(String key, int max_pipe_keys, int min_pipe_keys) throws Exception {
int pipe_keys = randomGenerator.nextInt(max_pipe_keys);
pipe_keys = Math.max(min_pipe_keys, pipe_keys);
DynoJedisPipeline pipeline = this.jedisClient.get().pipelined();
Map<String, Response<... | java | public String pipelineRead(String key, int max_pipe_keys, int min_pipe_keys) throws Exception {
int pipe_keys = randomGenerator.nextInt(max_pipe_keys);
pipe_keys = Math.max(min_pipe_keys, pipe_keys);
DynoJedisPipeline pipeline = this.jedisClient.get().pipelined();
Map<String, Response<... | [
"public",
"String",
"pipelineRead",
"(",
"String",
"key",
",",
"int",
"max_pipe_keys",
",",
"int",
"min_pipe_keys",
")",
"throws",
"Exception",
"{",
"int",
"pipe_keys",
"=",
"randomGenerator",
".",
"nextInt",
"(",
"max_pipe_keys",
")",
";",
"pipe_keys",
"=",
"... | This is the pipelined version of the reads
@param key
@return "OK" if everything was read
@throws Exception | [
"This",
"is",
"the",
"pipelined",
"version",
"of",
"the",
"reads"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L72-L110 |
55,171 | Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.pipelineReadHGETALL | public String pipelineReadHGETALL(String key, String hm_key_prefix) throws Exception {
DynoJedisPipeline pipeline = jedisClient.get().pipelined();
Response<Map<byte[], byte[]>> resp = pipeline.hgetAll((hm_key_prefix + key).getBytes());
pipeline.sync();
if (resp == null || resp.get() == n... | java | public String pipelineReadHGETALL(String key, String hm_key_prefix) throws Exception {
DynoJedisPipeline pipeline = jedisClient.get().pipelined();
Response<Map<byte[], byte[]>> resp = pipeline.hgetAll((hm_key_prefix + key).getBytes());
pipeline.sync();
if (resp == null || resp.get() == n... | [
"public",
"String",
"pipelineReadHGETALL",
"(",
"String",
"key",
",",
"String",
"hm_key_prefix",
")",
"throws",
"Exception",
"{",
"DynoJedisPipeline",
"pipeline",
"=",
"jedisClient",
".",
"get",
"(",
")",
".",
"pipelined",
"(",
")",
";",
"Response",
"<",
"Map"... | This the pipelined HGETALL
@param key
@return the contents of the hash
@throws Exception | [
"This",
"the",
"pipelined",
"HGETALL"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L119-L136 |
55,172 | Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.nonPipelineZRANGE | public String nonPipelineZRANGE(String key, int max_score) {
StringBuilder sb = new StringBuilder();
// Return all elements
Set<String> returnEntries = this.jedisClient.get().zrange(key, 0, -1);
if (returnEntries.isEmpty()) {
logger.error("The number of entries in the sorted ... | java | public String nonPipelineZRANGE(String key, int max_score) {
StringBuilder sb = new StringBuilder();
// Return all elements
Set<String> returnEntries = this.jedisClient.get().zrange(key, 0, -1);
if (returnEntries.isEmpty()) {
logger.error("The number of entries in the sorted ... | [
"public",
"String",
"nonPipelineZRANGE",
"(",
"String",
"key",
",",
"int",
"max_score",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// Return all elements",
"Set",
"<",
"String",
">",
"returnEntries",
"=",
"this",
".",
"jedisC... | Exercising ZRANGE to receive all keys between 0 and MAX_SCORE
@param key | [
"Exercising",
"ZRANGE",
"to",
"receive",
"all",
"keys",
"between",
"0",
"and",
"MAX_SCORE"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L143-L154 |
55,173 | Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.nonpipelineWrite | public String nonpipelineWrite(String key, DataGenerator dataGenerator) {
String value = key + "__" + dataGenerator.getRandomValue() + "__" + key;
String result = this.jedisClient.get().set(key, value);
if (!"OK".equals(result)) {
logger.error("SET_ERROR: GOT " + result + " for SET ... | java | public String nonpipelineWrite(String key, DataGenerator dataGenerator) {
String value = key + "__" + dataGenerator.getRandomValue() + "__" + key;
String result = this.jedisClient.get().set(key, value);
if (!"OK".equals(result)) {
logger.error("SET_ERROR: GOT " + result + " for SET ... | [
"public",
"String",
"nonpipelineWrite",
"(",
"String",
"key",
",",
"DataGenerator",
"dataGenerator",
")",
"{",
"String",
"value",
"=",
"key",
"+",
"\"__\"",
"+",
"dataGenerator",
".",
"getRandomValue",
"(",
")",
"+",
"\"__\"",
"+",
"key",
";",
"String",
"res... | a simple write without a pipeline
@param key
@return the result of write (i.e. "OK" if it was successful | [
"a",
"simple",
"write",
"without",
"a",
"pipeline"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L162-L173 |
55,174 | Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.pipelineWrite | public String pipelineWrite(String key, DataGenerator dataGenerator, int max_pipe_keys, int min_pipe_keys)
throws Exception {
// Create a random key between [0,MAX_PIPE_KEYS]
int pipe_keys = randomGenerator.nextInt(max_pipe_keys);
// Make sure that the number of keys in the pipeline... | java | public String pipelineWrite(String key, DataGenerator dataGenerator, int max_pipe_keys, int min_pipe_keys)
throws Exception {
// Create a random key between [0,MAX_PIPE_KEYS]
int pipe_keys = randomGenerator.nextInt(max_pipe_keys);
// Make sure that the number of keys in the pipeline... | [
"public",
"String",
"pipelineWrite",
"(",
"String",
"key",
",",
"DataGenerator",
"dataGenerator",
",",
"int",
"max_pipe_keys",
",",
"int",
"min_pipe_keys",
")",
"throws",
"Exception",
"{",
"// Create a random key between [0,MAX_PIPE_KEYS]",
"int",
"pipe_keys",
"=",
"ran... | pipelined version of the write
@param key
@return "key_n" | [
"pipelined",
"version",
"of",
"the",
"write"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L181-L209 |
55,175 | Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.pipelineWriteHMSET | public String pipelineWriteHMSET(String key, DataGenerator dataGenerator, String hm_key_prefix) {
Map<String, String> map = new HashMap<>();
String hmKey = hm_key_prefix + key;
map.put((hmKey + "__1"), (key + "__" + dataGenerator.getRandomValue() + "__" + key));
map.put((hmKey + "__2"), ... | java | public String pipelineWriteHMSET(String key, DataGenerator dataGenerator, String hm_key_prefix) {
Map<String, String> map = new HashMap<>();
String hmKey = hm_key_prefix + key;
map.put((hmKey + "__1"), (key + "__" + dataGenerator.getRandomValue() + "__" + key));
map.put((hmKey + "__2"), ... | [
"public",
"String",
"pipelineWriteHMSET",
"(",
"String",
"key",
",",
"DataGenerator",
"dataGenerator",
",",
"String",
"hm_key_prefix",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"String",
"hmKey",
... | writes with an pipelined HMSET
@param key
@return the keys of the hash that was stored. | [
"writes",
"with",
"an",
"pipelined",
"HMSET"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L217-L229 |
55,176 | Netflix/ndbench | ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java | DynoJedisUtils.nonPipelineZADD | public String nonPipelineZADD(String key, DataGenerator dataGenerator, String z_key_prefix, int max_score)
throws Exception {
String zKey = z_key_prefix + key;
int success = 0;
long returnOp = 0;
for (int i = 0; i < max_score; i++) {
returnOp = jedisClient.get().... | java | public String nonPipelineZADD(String key, DataGenerator dataGenerator, String z_key_prefix, int max_score)
throws Exception {
String zKey = z_key_prefix + key;
int success = 0;
long returnOp = 0;
for (int i = 0; i < max_score; i++) {
returnOp = jedisClient.get().... | [
"public",
"String",
"nonPipelineZADD",
"(",
"String",
"key",
",",
"DataGenerator",
"dataGenerator",
",",
"String",
"z_key_prefix",
",",
"int",
"max_score",
")",
"throws",
"Exception",
"{",
"String",
"zKey",
"=",
"z_key_prefix",
"+",
"key",
";",
"int",
"success",... | This adds MAX_SCORE of elements in a sorted set
@param key
@return "OK" if all write operations have succeeded
@throws Exception | [
"This",
"adds",
"MAX_SCORE",
"of",
"elements",
"in",
"a",
"sorted",
"set"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-dyno-plugins/src/main/java/com/netflix/ndbench/plugin/dyno/DynoJedisUtils.java#L238-L253 |
55,177 | Netflix/ndbench | ndbench-es-plugins/src/main/java/com/netflix/ndbench/plugin/es/EsRestPlugin.java | EsRestPlugin.init | @Override
public synchronized void init(DataGenerator dataGenerator) throws Exception {
if (esConfig.getRestClientPort() == 443 && !esConfig.isHttps()) {
throw new IllegalArgumentException(
"You must set the configuration property 'https' to true if you use the https default ... | java | @Override
public synchronized void init(DataGenerator dataGenerator) throws Exception {
if (esConfig.getRestClientPort() == 443 && !esConfig.isHttps()) {
throw new IllegalArgumentException(
"You must set the configuration property 'https' to true if you use the https default ... | [
"@",
"Override",
"public",
"synchronized",
"void",
"init",
"(",
"DataGenerator",
"dataGenerator",
")",
"throws",
"Exception",
"{",
"if",
"(",
"esConfig",
".",
"getRestClientPort",
"(",
")",
"==",
"443",
"&&",
"!",
"esConfig",
".",
"isHttps",
"(",
")",
")",
... | Initialize key data structures for plugin, using 'synchronized' to ensure other threads are guaranteed
visibility of end result of initializing said structures.
@throws Exception | [
"Initialize",
"key",
"data",
"structures",
"for",
"plugin",
"using",
"synchronized",
"to",
"ensure",
"other",
"threads",
"are",
"guaranteed",
"visibility",
"of",
"end",
"result",
"of",
"initializing",
"said",
"structures",
"."
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-es-plugins/src/main/java/com/netflix/ndbench/plugin/es/EsRestPlugin.java#L105-L171 |
55,178 | Netflix/ndbench | ndbench-core/src/main/java/com/netflix/ndbench/core/util/NdbUtil.java | NdbUtil.humanReadableByteCount | public static String humanReadableByteCount(final long bytes)
{
final int base = 1024;
// When using the smallest unit no decimal point is needed, because it's the exact number.
if (bytes < base) {
return bytes + " " + BINARY_UNITS[0];
}
final int exponent = (in... | java | public static String humanReadableByteCount(final long bytes)
{
final int base = 1024;
// When using the smallest unit no decimal point is needed, because it's the exact number.
if (bytes < base) {
return bytes + " " + BINARY_UNITS[0];
}
final int exponent = (in... | [
"public",
"static",
"String",
"humanReadableByteCount",
"(",
"final",
"long",
"bytes",
")",
"{",
"final",
"int",
"base",
"=",
"1024",
";",
"// When using the smallest unit no decimal point is needed, because it's the exact number.",
"if",
"(",
"bytes",
"<",
"base",
")",
... | FileUtils.byteCountToDisplaySize rounds down the size, hence using this for more precision.
@param bytes bytes
@return human readable bytes | [
"FileUtils",
".",
"byteCountToDisplaySize",
"rounds",
"down",
"the",
"size",
"hence",
"using",
"this",
"for",
"more",
"precision",
"."
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-core/src/main/java/com/netflix/ndbench/core/util/NdbUtil.java#L19-L31 |
55,179 | Netflix/ndbench | ndbench-es-plugins/src/main/java/com/netflix/ndbench/plugin/es/EsWriter.java | EsWriter.constructIndexName | static String constructIndexName(String indexName, int indexRollsPerDay, Date date) {
if (indexRollsPerDay > 0) {
ZonedDateTime zdt = ZonedDateTime.ofInstant(date.toInstant(), ZoneId.of("UTC"));
int minutesPerRoll = 1440 / indexRollsPerDay;
int minutesElapsedSinceStartOfDay ... | java | static String constructIndexName(String indexName, int indexRollsPerDay, Date date) {
if (indexRollsPerDay > 0) {
ZonedDateTime zdt = ZonedDateTime.ofInstant(date.toInstant(), ZoneId.of("UTC"));
int minutesPerRoll = 1440 / indexRollsPerDay;
int minutesElapsedSinceStartOfDay ... | [
"static",
"String",
"constructIndexName",
"(",
"String",
"indexName",
",",
"int",
"indexRollsPerDay",
",",
"Date",
"date",
")",
"{",
"if",
"(",
"indexRollsPerDay",
">",
"0",
")",
"{",
"ZonedDateTime",
"zdt",
"=",
"ZonedDateTime",
".",
"ofInstant",
"(",
"date",... | methods below are package scoped to facilitate unit testing | [
"methods",
"below",
"are",
"package",
"scoped",
"to",
"facilitate",
"unit",
"testing"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-es-plugins/src/main/java/com/netflix/ndbench/plugin/es/EsWriter.java#L195-L208 |
55,180 | Netflix/ndbench | ndbench-janusgraph-plugins/src/main/java/com/netflix/ndbench/plugin/janusgraph/JanusGraphPluginCQL.java | JanusGraphPluginCQL.readBulk | public List<String> readBulk(final List<String> keys) throws Exception {
List<String> responses = new ArrayList<>(keys.size());
JanusGraphTransaction transaction = useJanusgraphTransaction ? graph.newTransaction() : null;
try {
for (String key : keys) {
String respon... | java | public List<String> readBulk(final List<String> keys) throws Exception {
List<String> responses = new ArrayList<>(keys.size());
JanusGraphTransaction transaction = useJanusgraphTransaction ? graph.newTransaction() : null;
try {
for (String key : keys) {
String respon... | [
"public",
"List",
"<",
"String",
">",
"readBulk",
"(",
"final",
"List",
"<",
"String",
">",
"keys",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"responses",
"=",
"new",
"ArrayList",
"<>",
"(",
"keys",
".",
"size",
"(",
")",
")",
";",... | Perform a bulk read operation
@return a list of response codes
@throws Exception | [
"Perform",
"a",
"bulk",
"read",
"operation"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-janusgraph-plugins/src/main/java/com/netflix/ndbench/plugin/janusgraph/JanusGraphPluginCQL.java#L137-L151 |
55,181 | Netflix/ndbench | ndbench-janusgraph-plugins/src/main/java/com/netflix/ndbench/plugin/janusgraph/JanusGraphPluginCQL.java | JanusGraphPluginCQL.writeBulk | public List<String> writeBulk(final List<String> keys) throws Exception {
List<String> responses = new ArrayList<>(keys.size());
for (String key : keys) {
String response = writeSingle(key);
responses.add(response);
}
return responses;
} | java | public List<String> writeBulk(final List<String> keys) throws Exception {
List<String> responses = new ArrayList<>(keys.size());
for (String key : keys) {
String response = writeSingle(key);
responses.add(response);
}
return responses;
} | [
"public",
"List",
"<",
"String",
">",
"writeBulk",
"(",
"final",
"List",
"<",
"String",
">",
"keys",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"responses",
"=",
"new",
"ArrayList",
"<>",
"(",
"keys",
".",
"size",
"(",
")",
")",
";"... | Perform a bulk write operation
@return a list of response codes
@throws Exception | [
"Perform",
"a",
"bulk",
"write",
"operation"
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-janusgraph-plugins/src/main/java/com/netflix/ndbench/plugin/janusgraph/JanusGraphPluginCQL.java#L158-L165 |
55,182 | Netflix/ndbench | ndbench-cockroachdb-plugins/src/main/java/com/netflix/ndbench/plugin/cockroachdb/operations/CockroachDBPluginBase.java | CockroachDBPluginBase.getNDelimitedStrings | public String getNDelimitedStrings(int n)
{
return IntStream.range(0, config.getColsPerRow()).mapToObj(i -> "'" + dataGenerator.getRandomValue() + "'").collect(Collectors.joining(","));
} | java | public String getNDelimitedStrings(int n)
{
return IntStream.range(0, config.getColsPerRow()).mapToObj(i -> "'" + dataGenerator.getRandomValue() + "'").collect(Collectors.joining(","));
} | [
"public",
"String",
"getNDelimitedStrings",
"(",
"int",
"n",
")",
"{",
"return",
"IntStream",
".",
"range",
"(",
"0",
",",
"config",
".",
"getColsPerRow",
"(",
")",
")",
".",
"mapToObj",
"(",
"i",
"->",
"\"'\"",
"+",
"dataGenerator",
".",
"getRandomValue",... | Assumes delimiter to be comma since that covers all the usecase for now.
Will parameterize if use cases differ on delimiter.
@param n
@return | [
"Assumes",
"delimiter",
"to",
"be",
"comma",
"since",
"that",
"covers",
"all",
"the",
"usecase",
"for",
"now",
".",
"Will",
"parameterize",
"if",
"use",
"cases",
"differ",
"on",
"delimiter",
"."
] | 8d664244b5f9d01395248a296b86a3c822e6d764 | https://github.com/Netflix/ndbench/blob/8d664244b5f9d01395248a296b86a3c822e6d764/ndbench-cockroachdb-plugins/src/main/java/com/netflix/ndbench/plugin/cockroachdb/operations/CockroachDBPluginBase.java#L131-L134 |
55,183 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteCursorAdapter.java | OrmLiteCursorAdapter.doBindView | protected void doBindView(View itemView, Context context, Cursor cursor) {
try {
@SuppressWarnings("unchecked")
ViewType itemViewType = (ViewType) itemView;
bindView(itemViewType, context, cursorToObject(cursor));
} catch (SQLException e) {
throw new RuntimeException(e);
}
} | java | protected void doBindView(View itemView, Context context, Cursor cursor) {
try {
@SuppressWarnings("unchecked")
ViewType itemViewType = (ViewType) itemView;
bindView(itemViewType, context, cursorToObject(cursor));
} catch (SQLException e) {
throw new RuntimeException(e);
}
} | [
"protected",
"void",
"doBindView",
"(",
"View",
"itemView",
",",
"Context",
"context",
",",
"Cursor",
"cursor",
")",
"{",
"try",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"ViewType",
"itemViewType",
"=",
"(",
"ViewType",
")",
"itemView",
";",
... | This is here to make sure that the user really wants to override it. | [
"This",
"is",
"here",
"to",
"make",
"sure",
"that",
"the",
"user",
"really",
"wants",
"to",
"override",
"it",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteCursorAdapter.java#L45-L53 |
55,184 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteCursorAdapter.java | OrmLiteCursorAdapter.getTypedItem | public T getTypedItem(int position) {
try {
return cursorToObject((Cursor) super.getItem(position));
} catch (SQLException e) {
throw new RuntimeException(e);
}
} | java | public T getTypedItem(int position) {
try {
return cursorToObject((Cursor) super.getItem(position));
} catch (SQLException e) {
throw new RuntimeException(e);
}
} | [
"public",
"T",
"getTypedItem",
"(",
"int",
"position",
")",
"{",
"try",
"{",
"return",
"cursorToObject",
"(",
"(",
"Cursor",
")",
"super",
".",
"getItem",
"(",
"position",
")",
")",
";",
"}",
"catch",
"(",
"SQLException",
"e",
")",
"{",
"throw",
"new",... | Returns a T object at the current position. | [
"Returns",
"a",
"T",
"object",
"at",
"the",
"current",
"position",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteCursorAdapter.java#L58-L64 |
55,185 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteCursorAdapter.java | OrmLiteCursorAdapter.cursorToObject | protected T cursorToObject(Cursor cursor) throws SQLException {
return preparedQuery.mapRow(new AndroidDatabaseResults(cursor, null, true));
} | java | protected T cursorToObject(Cursor cursor) throws SQLException {
return preparedQuery.mapRow(new AndroidDatabaseResults(cursor, null, true));
} | [
"protected",
"T",
"cursorToObject",
"(",
"Cursor",
"cursor",
")",
"throws",
"SQLException",
"{",
"return",
"preparedQuery",
".",
"mapRow",
"(",
"new",
"AndroidDatabaseResults",
"(",
"cursor",
",",
"null",
",",
"true",
")",
")",
";",
"}"
] | Map a single row to our cursor object. | [
"Map",
"a",
"single",
"row",
"to",
"our",
"cursor",
"object",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteCursorAdapter.java#L69-L71 |
55,186 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteCursorAdapter.java | OrmLiteCursorAdapter.changeCursor | public void changeCursor(Cursor cursor, PreparedQuery<T> preparedQuery) {
setPreparedQuery(preparedQuery);
super.changeCursor(cursor);
} | java | public void changeCursor(Cursor cursor, PreparedQuery<T> preparedQuery) {
setPreparedQuery(preparedQuery);
super.changeCursor(cursor);
} | [
"public",
"void",
"changeCursor",
"(",
"Cursor",
"cursor",
",",
"PreparedQuery",
"<",
"T",
">",
"preparedQuery",
")",
"{",
"setPreparedQuery",
"(",
"preparedQuery",
")",
";",
"super",
".",
"changeCursor",
"(",
"cursor",
")",
";",
"}"
] | Change the cursor associated with the prepared query. | [
"Change",
"the",
"cursor",
"associated",
"with",
"the",
"prepared",
"query",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteCursorAdapter.java#L85-L88 |
55,187 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/AndroidCompiledStatement.java | AndroidCompiledStatement.execSql | static int execSql(SQLiteDatabase db, String label, String finalSql, Object[] argArray) throws SQLException {
try {
db.execSQL(finalSql, argArray);
} catch (android.database.SQLException e) {
throw SqlExceptionUtil.create("Problems executing " + label + " Android statement: " + finalSql, e);
}
int result;... | java | static int execSql(SQLiteDatabase db, String label, String finalSql, Object[] argArray) throws SQLException {
try {
db.execSQL(finalSql, argArray);
} catch (android.database.SQLException e) {
throw SqlExceptionUtil.create("Problems executing " + label + " Android statement: " + finalSql, e);
}
int result;... | [
"static",
"int",
"execSql",
"(",
"SQLiteDatabase",
"db",
",",
"String",
"label",
",",
"String",
"finalSql",
",",
"Object",
"[",
"]",
"argArray",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"db",
".",
"execSQL",
"(",
"finalSql",
",",
"argArray",
")",
... | Execute some SQL on the database and return the number of rows changed. | [
"Execute",
"some",
"SQL",
"on",
"the",
"database",
"and",
"return",
"the",
"number",
"of",
"rows",
"changed",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/AndroidCompiledStatement.java#L212-L234 |
55,188 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java | OrmLiteConfigUtil.writeConfigFile | public static void writeConfigFile(String fileName, boolean sortClasses) throws SQLException, IOException {
List<Class<?>> classList = new ArrayList<Class<?>>();
findAnnotatedClasses(classList, new File("."), 0);
writeConfigFile(fileName, classList.toArray(new Class[classList.size()]), sortClasses);
} | java | public static void writeConfigFile(String fileName, boolean sortClasses) throws SQLException, IOException {
List<Class<?>> classList = new ArrayList<Class<?>>();
findAnnotatedClasses(classList, new File("."), 0);
writeConfigFile(fileName, classList.toArray(new Class[classList.size()]), sortClasses);
} | [
"public",
"static",
"void",
"writeConfigFile",
"(",
"String",
"fileName",
",",
"boolean",
"sortClasses",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"classList",
"=",
"new",
"ArrayList",
"<",
"Class",
"<"... | Finds the annotated classes in the current directory or below and writes a configuration file to the file-name in
the raw folder.
@param sortClasses
Set to true to sort the classes by name before the file is generated. | [
"Finds",
"the",
"annotated",
"classes",
"in",
"the",
"current",
"directory",
"or",
"below",
"and",
"writes",
"a",
"configuration",
"file",
"to",
"the",
"file",
"-",
"name",
"in",
"the",
"raw",
"folder",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java#L115-L119 |
55,189 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java | OrmLiteConfigUtil.writeConfigFile | public static void writeConfigFile(File configFile, boolean sortClasses) throws SQLException, IOException {
writeConfigFile(configFile, new File("."), sortClasses);
} | java | public static void writeConfigFile(File configFile, boolean sortClasses) throws SQLException, IOException {
writeConfigFile(configFile, new File("."), sortClasses);
} | [
"public",
"static",
"void",
"writeConfigFile",
"(",
"File",
"configFile",
",",
"boolean",
"sortClasses",
")",
"throws",
"SQLException",
",",
"IOException",
"{",
"writeConfigFile",
"(",
"configFile",
",",
"new",
"File",
"(",
"\".\"",
")",
",",
"sortClasses",
")",... | Finds the annotated classes in the current directory or below and writes a configuration file.
@param sortClasses
Set to true to sort the classes by name before the file is generated. | [
"Finds",
"the",
"annotated",
"classes",
"in",
"the",
"current",
"directory",
"or",
"below",
"and",
"writes",
"a",
"configuration",
"file",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java#L159-L161 |
55,190 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java | OrmLiteConfigUtil.findRawDir | protected static File findRawDir(File dir) {
for (int i = 0; dir != null && i < 20; i++) {
File rawDir = findResRawDir(dir);
if (rawDir != null) {
return rawDir;
}
dir = dir.getParentFile();
}
return null;
} | java | protected static File findRawDir(File dir) {
for (int i = 0; dir != null && i < 20; i++) {
File rawDir = findResRawDir(dir);
if (rawDir != null) {
return rawDir;
}
dir = dir.getParentFile();
}
return null;
} | [
"protected",
"static",
"File",
"findRawDir",
"(",
"File",
"dir",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"dir",
"!=",
"null",
"&&",
"i",
"<",
"20",
";",
"i",
"++",
")",
"{",
"File",
"rawDir",
"=",
"findResRawDir",
"(",
"dir",
")",
";",
... | Look for the resource-directory in the current directory or the directories above. Then look for the
raw-directory underneath the resource-directory. | [
"Look",
"for",
"the",
"resource",
"-",
"directory",
"in",
"the",
"current",
"directory",
"or",
"the",
"directories",
"above",
".",
"Then",
"look",
"for",
"the",
"raw",
"-",
"directory",
"underneath",
"the",
"resource",
"-",
"directory",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java#L261-L270 |
55,191 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java | OrmLiteConfigUtil.getPackageOfClass | private static String getPackageOfClass(File file) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(file));
try {
while (true) {
String line = reader.readLine();
if (line == null) {
return null;
}
if (line.contains("package")) {
String[] parts = line.split(... | java | private static String getPackageOfClass(File file) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(file));
try {
while (true) {
String line = reader.readLine();
if (line == null) {
return null;
}
if (line.contains("package")) {
String[] parts = line.split(... | [
"private",
"static",
"String",
"getPackageOfClass",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"reader",
"=",
"new",
"BufferedReader",
"(",
"new",
"FileReader",
"(",
"file",
")",
")",
";",
"try",
"{",
"while",
"(",
"true",
")",... | Returns the package name of a file that has one of the annotations we are looking for.
@return Package prefix string or null or no annotations. | [
"Returns",
"the",
"package",
"name",
"of",
"a",
"file",
"that",
"has",
"one",
"of",
"the",
"annotations",
"we",
"are",
"looking",
"for",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java#L401-L419 |
55,192 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java | OrmLiteConfigUtil.findResRawDir | private static File findResRawDir(File dir) {
for (File file : dir.listFiles()) {
if (file.getName().equals(RESOURCE_DIR_NAME) && file.isDirectory()) {
File[] rawFiles = file.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.getName().equals(RAW_DIR_NAME) && ... | java | private static File findResRawDir(File dir) {
for (File file : dir.listFiles()) {
if (file.getName().equals(RESOURCE_DIR_NAME) && file.isDirectory()) {
File[] rawFiles = file.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.getName().equals(RAW_DIR_NAME) && ... | [
"private",
"static",
"File",
"findResRawDir",
"(",
"File",
"dir",
")",
"{",
"for",
"(",
"File",
"file",
":",
"dir",
".",
"listFiles",
"(",
")",
")",
"{",
"if",
"(",
"file",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"RESOURCE_DIR_NAME",
")",
"&&",... | Look for the resource directory with raw beneath it. | [
"Look",
"for",
"the",
"resource",
"directory",
"with",
"raw",
"beneath",
"it",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteConfigUtil.java#L424-L439 |
55,193 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java | OpenHelperManager.innerSetHelperClass | private static void innerSetHelperClass(Class<? extends OrmLiteSqliteOpenHelper> openHelperClass) {
// make sure if that there are not 2 helper classes in an application
if (openHelperClass == null) {
throw new IllegalStateException("Helper class was trying to be reset to null");
} else if (helperClass == null... | java | private static void innerSetHelperClass(Class<? extends OrmLiteSqliteOpenHelper> openHelperClass) {
// make sure if that there are not 2 helper classes in an application
if (openHelperClass == null) {
throw new IllegalStateException("Helper class was trying to be reset to null");
} else if (helperClass == null... | [
"private",
"static",
"void",
"innerSetHelperClass",
"(",
"Class",
"<",
"?",
"extends",
"OrmLiteSqliteOpenHelper",
">",
"openHelperClass",
")",
"{",
"// make sure if that there are not 2 helper classes in an application",
"if",
"(",
"openHelperClass",
"==",
"null",
")",
"{",... | Set the helper class and make sure we aren't changing it to another class. | [
"Set",
"the",
"helper",
"class",
"and",
"make",
"sure",
"we",
"aren",
"t",
"changing",
"it",
"to",
"another",
"class",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java#L145-L155 |
55,194 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java | OpenHelperManager.constructHelper | private static OrmLiteSqliteOpenHelper constructHelper(Context context,
Class<? extends OrmLiteSqliteOpenHelper> openHelperClass) {
Constructor<?> constructor;
try {
constructor = openHelperClass.getConstructor(Context.class);
} catch (Exception e) {
throw new IllegalStateException(
"Could not find ... | java | private static OrmLiteSqliteOpenHelper constructHelper(Context context,
Class<? extends OrmLiteSqliteOpenHelper> openHelperClass) {
Constructor<?> constructor;
try {
constructor = openHelperClass.getConstructor(Context.class);
} catch (Exception e) {
throw new IllegalStateException(
"Could not find ... | [
"private",
"static",
"OrmLiteSqliteOpenHelper",
"constructHelper",
"(",
"Context",
"context",
",",
"Class",
"<",
"?",
"extends",
"OrmLiteSqliteOpenHelper",
">",
"openHelperClass",
")",
"{",
"Constructor",
"<",
"?",
">",
"constructor",
";",
"try",
"{",
"constructor",... | Call the constructor on our helper class. | [
"Call",
"the",
"constructor",
"on",
"our",
"helper",
"class",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java#L206-L221 |
55,195 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java | OpenHelperManager.lookupHelperClass | private static Class<? extends OrmLiteSqliteOpenHelper> lookupHelperClass(Context context, Class<?> componentClass) {
// see if we have the magic resource class name set
Resources resources = context.getResources();
int resourceId = resources.getIdentifier(HELPER_CLASS_RESOURCE_NAME, "string", context.getPackage... | java | private static Class<? extends OrmLiteSqliteOpenHelper> lookupHelperClass(Context context, Class<?> componentClass) {
// see if we have the magic resource class name set
Resources resources = context.getResources();
int resourceId = resources.getIdentifier(HELPER_CLASS_RESOURCE_NAME, "string", context.getPackage... | [
"private",
"static",
"Class",
"<",
"?",
"extends",
"OrmLiteSqliteOpenHelper",
">",
"lookupHelperClass",
"(",
"Context",
"context",
",",
"Class",
"<",
"?",
">",
"componentClass",
")",
"{",
"// see if we have the magic resource class name set",
"Resources",
"resources",
"... | Lookup the helper class either from the resource string or by looking for a generic parameter. | [
"Lookup",
"the",
"helper",
"class",
"either",
"from",
"the",
"resource",
"string",
"or",
"by",
"looking",
"for",
"a",
"generic",
"parameter",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OpenHelperManager.java#L226-L273 |
55,196 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java | DatabaseTableConfigUtil.fromClass | public static <T> DatabaseTableConfig<T> fromClass(ConnectionSource connectionSource, Class<T> clazz)
throws SQLException {
DatabaseType databaseType = connectionSource.getDatabaseType();
String tableName = DatabaseTableConfig.extractTableName(databaseType, clazz);
List<DatabaseFieldConfig> fieldConfigs = new ... | java | public static <T> DatabaseTableConfig<T> fromClass(ConnectionSource connectionSource, Class<T> clazz)
throws SQLException {
DatabaseType databaseType = connectionSource.getDatabaseType();
String tableName = DatabaseTableConfig.extractTableName(databaseType, clazz);
List<DatabaseFieldConfig> fieldConfigs = new ... | [
"public",
"static",
"<",
"T",
">",
"DatabaseTableConfig",
"<",
"T",
">",
"fromClass",
"(",
"ConnectionSource",
"connectionSource",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"SQLException",
"{",
"DatabaseType",
"databaseType",
"=",
"connectionSource",
... | Build our list table config from a class using some annotation fu around. | [
"Build",
"our",
"list",
"table",
"config",
"from",
"a",
"class",
"using",
"some",
"annotation",
"fu",
"around",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java#L61-L79 |
55,197 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java | DatabaseTableConfigUtil.lookupClasses | private static int[] lookupClasses() {
Class<?> annotationMemberArrayClazz;
try {
annotationFactoryClazz = Class.forName("org.apache.harmony.lang.annotation.AnnotationFactory");
annotationMemberClazz = Class.forName("org.apache.harmony.lang.annotation.AnnotationMember");
annotationMemberArrayClazz = Class.... | java | private static int[] lookupClasses() {
Class<?> annotationMemberArrayClazz;
try {
annotationFactoryClazz = Class.forName("org.apache.harmony.lang.annotation.AnnotationFactory");
annotationMemberClazz = Class.forName("org.apache.harmony.lang.annotation.AnnotationMember");
annotationMemberArrayClazz = Class.... | [
"private",
"static",
"int",
"[",
"]",
"lookupClasses",
"(",
")",
"{",
"Class",
"<",
"?",
">",
"annotationMemberArrayClazz",
";",
"try",
"{",
"annotationFactoryClazz",
"=",
"Class",
".",
"forName",
"(",
"\"org.apache.harmony.lang.annotation.AnnotationFactory\"",
")",
... | This does all of the class reflection fu to find our classes, find the order of field names, and construct our
array of ConfigField entries the correspond to the AnnotationMember array. | [
"This",
"does",
"all",
"of",
"the",
"class",
"reflection",
"fu",
"to",
"find",
"our",
"classes",
"find",
"the",
"order",
"of",
"field",
"names",
"and",
"construct",
"our",
"array",
"of",
"ConfigField",
"entries",
"the",
"correspond",
"to",
"the",
"Annotation... | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java#L92-L144 |
55,198 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java | DatabaseTableConfigUtil.configFieldNameToNum | private static int configFieldNameToNum(String configName) {
if (configName.equals("columnName")) {
return COLUMN_NAME;
} else if (configName.equals("dataType")) {
return DATA_TYPE;
} else if (configName.equals("defaultValue")) {
return DEFAULT_VALUE;
} else if (configName.equals("width")) {
return ... | java | private static int configFieldNameToNum(String configName) {
if (configName.equals("columnName")) {
return COLUMN_NAME;
} else if (configName.equals("dataType")) {
return DATA_TYPE;
} else if (configName.equals("defaultValue")) {
return DEFAULT_VALUE;
} else if (configName.equals("width")) {
return ... | [
"private",
"static",
"int",
"configFieldNameToNum",
"(",
"String",
"configName",
")",
"{",
"if",
"(",
"configName",
".",
"equals",
"(",
"\"columnName\"",
")",
")",
"{",
"return",
"COLUMN_NAME",
";",
"}",
"else",
"if",
"(",
"configName",
".",
"equals",
"(",
... | Convert the name of the @DatabaseField fields into a number for easy processing later. | [
"Convert",
"the",
"name",
"of",
"the"
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java#L184-L248 |
55,199 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java | DatabaseTableConfigUtil.buildConfig | private static DatabaseFieldConfig buildConfig(DatabaseField databaseField, String tableName, Field field)
throws Exception {
InvocationHandler proxy = Proxy.getInvocationHandler(databaseField);
if (proxy.getClass() != annotationFactoryClazz) {
return null;
}
// this should be an array of AnnotationMember... | java | private static DatabaseFieldConfig buildConfig(DatabaseField databaseField, String tableName, Field field)
throws Exception {
InvocationHandler proxy = Proxy.getInvocationHandler(databaseField);
if (proxy.getClass() != annotationFactoryClazz) {
return null;
}
// this should be an array of AnnotationMember... | [
"private",
"static",
"DatabaseFieldConfig",
"buildConfig",
"(",
"DatabaseField",
"databaseField",
",",
"String",
"tableName",
",",
"Field",
"field",
")",
"throws",
"Exception",
"{",
"InvocationHandler",
"proxy",
"=",
"Proxy",
".",
"getInvocationHandler",
"(",
"databas... | Instead of calling the annotation methods directly, we peer inside the proxy and investigate the array of
AnnotationMember objects stored by the AnnotationFactory. | [
"Instead",
"of",
"calling",
"the",
"annotation",
"methods",
"directly",
"we",
"peer",
"inside",
"the",
"proxy",
"and",
"investigate",
"the",
"array",
"of",
"AnnotationMember",
"objects",
"stored",
"by",
"the",
"AnnotationFactory",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java#L292-L312 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.