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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
12,300 | Harium/keel | src/main/java/com/harium/keel/effect/CosineTransform.java | CosineTransform.PowerSpectrum | private void PowerSpectrum() {
Power = new double[data.length][data[0].length];
PowerMax = 0;
for (int i = 0; i < data.length; i++) {
for (int j = 0; j < data[0].length; j++) {
double p = data[i][j];
if (p < 0) p = -p;
Power[i]... | java | private void PowerSpectrum() {
Power = new double[data.length][data[0].length];
PowerMax = 0;
for (int i = 0; i < data.length; i++) {
for (int j = 0; j < data[0].length; j++) {
double p = data[i][j];
if (p < 0) p = -p;
Power[i]... | [
"private",
"void",
"PowerSpectrum",
"(",
")",
"{",
"Power",
"=",
"new",
"double",
"[",
"data",
".",
"length",
"]",
"[",
"data",
"[",
"0",
"]",
".",
"length",
"]",
";",
"PowerMax",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | compute the Power Spectrum; | [
"compute",
"the",
"Power",
"Spectrum",
";"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/CosineTransform.java#L147-L159 |
12,301 | Harium/keel | src/main/java/com/harium/keel/effect/normal/SimpleNormalMap.java | SimpleNormalMap.apply | @Override
public ImageSource apply(ImageSource input) {
int w = input.getWidth();
int h = input.getHeight();
MatrixSource output = new MatrixSource(w, h);
Vector3 s = new Vector3(1, 0, 0);
Vector3 t = new Vector3(0, 1, 0);
for (int y = 0; y < h; y++) {
... | java | @Override
public ImageSource apply(ImageSource input) {
int w = input.getWidth();
int h = input.getHeight();
MatrixSource output = new MatrixSource(w, h);
Vector3 s = new Vector3(1, 0, 0);
Vector3 t = new Vector3(0, 1, 0);
for (int y = 0; y < h; y++) {
... | [
"@",
"Override",
"public",
"ImageSource",
"apply",
"(",
"ImageSource",
"input",
")",
"{",
"int",
"w",
"=",
"input",
".",
"getWidth",
"(",
")",
";",
"int",
"h",
"=",
"input",
".",
"getHeight",
"(",
")",
";",
"MatrixSource",
"output",
"=",
"new",
"Matrix... | Simple method to generate bump map from a height map
@param input - A height map
@return bump map | [
"Simple",
"method",
"to",
"generate",
"bump",
"map",
"from",
"a",
"height",
"map"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/normal/SimpleNormalMap.java#L19-L50 |
12,302 | Harium/keel | src/main/java/jdt/triangulation/DelaunayTriangulation.java | DelaunayTriangulation.findClosePoint | public Vector3 findClosePoint(Vector3 pointToDelete) {
Triangle triangle = find(pointToDelete);
Vector3 p1 = triangle.p1();
Vector3 p2 = triangle.p2();
double d1 = distanceXY(p1, pointToDelete);
double d2 = distanceXY(p2, pointToDelete);
if(triangle.isHalfplane()) {
if(d1<=d2) {
return p1;
... | java | public Vector3 findClosePoint(Vector3 pointToDelete) {
Triangle triangle = find(pointToDelete);
Vector3 p1 = triangle.p1();
Vector3 p2 = triangle.p2();
double d1 = distanceXY(p1, pointToDelete);
double d2 = distanceXY(p2, pointToDelete);
if(triangle.isHalfplane()) {
if(d1<=d2) {
return p1;
... | [
"public",
"Vector3",
"findClosePoint",
"(",
"Vector3",
"pointToDelete",
")",
"{",
"Triangle",
"triangle",
"=",
"find",
"(",
"pointToDelete",
")",
";",
"Vector3",
"p1",
"=",
"triangle",
".",
"p1",
"(",
")",
";",
"Vector3",
"p2",
"=",
"triangle",
".",
"p2",
... | return a point from the trangulation that is close to pointToDelete
@param pointToDelete the point that the user wants to delete
@return a point from the trangulation that is close to pointToDelete
By Eyal Roth & Doron Ganel (2009). | [
"return",
"a",
"point",
"from",
"the",
"trangulation",
"that",
"is",
"close",
"to",
"pointToDelete"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/DelaunayTriangulation.java#L207-L235 |
12,303 | Harium/keel | src/main/java/jdt/triangulation/DelaunayTriangulation.java | DelaunayTriangulation.findTriangleNeighborhood | public List<Triangle> findTriangleNeighborhood(Triangle firstTriangle, Vector3 point) {
List<Triangle> triangles = new ArrayList<Triangle>(30);
triangles.add(firstTriangle);
Triangle prevTriangle = null;
Triangle currentTriangle = firstTriangle;
Triangle nextTriangle = currentTriangle.nextNeighbor(poin... | java | public List<Triangle> findTriangleNeighborhood(Triangle firstTriangle, Vector3 point) {
List<Triangle> triangles = new ArrayList<Triangle>(30);
triangles.add(firstTriangle);
Triangle prevTriangle = null;
Triangle currentTriangle = firstTriangle;
Triangle nextTriangle = currentTriangle.nextNeighbor(poin... | [
"public",
"List",
"<",
"Triangle",
">",
"findTriangleNeighborhood",
"(",
"Triangle",
"firstTriangle",
",",
"Vector3",
"point",
")",
"{",
"List",
"<",
"Triangle",
">",
"triangles",
"=",
"new",
"ArrayList",
"<",
"Triangle",
">",
"(",
"30",
")",
";",
"triangles... | changed to public by Udi | [
"changed",
"to",
"public",
"by",
"Udi"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/DelaunayTriangulation.java#L1180-L1201 |
12,304 | Harium/keel | src/main/java/jdt/triangulation/DelaunayTriangulation.java | DelaunayTriangulation.getConvexHullVerticesIterator | private Iterator<Vector3> getConvexHullVerticesIterator() {
List<Vector3> ans = new ArrayList<Vector3>();
Triangle curr = this.startTriangleHull;
boolean cont = true;
double x0 = bbMin.x, x1 = bbMax.x;
double y0 = bbMin.y, y1 = bbMax.y;
boolean sx, sy;
while (cont) {
sx = curr.p1().x == x0 || c... | java | private Iterator<Vector3> getConvexHullVerticesIterator() {
List<Vector3> ans = new ArrayList<Vector3>();
Triangle curr = this.startTriangleHull;
boolean cont = true;
double x0 = bbMin.x, x1 = bbMax.x;
double y0 = bbMin.y, y1 = bbMax.y;
boolean sx, sy;
while (cont) {
sx = curr.p1().x == x0 || c... | [
"private",
"Iterator",
"<",
"Vector3",
">",
"getConvexHullVerticesIterator",
"(",
")",
"{",
"List",
"<",
"Vector3",
">",
"ans",
"=",
"new",
"ArrayList",
"<",
"Vector3",
">",
"(",
")",
";",
"Triangle",
"curr",
"=",
"this",
".",
"startTriangleHull",
";",
"bo... | returns an iterator to the set of all the points on the XY-convex hull
@return iterator to the set of all the points on the XY-convex hull. | [
"returns",
"an",
"iterator",
"to",
"the",
"set",
"of",
"all",
"the",
"points",
"on",
"the",
"XY",
"-",
"convex",
"hull"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/jdt/triangulation/DelaunayTriangulation.java#L1369-L1388 |
12,305 | Harium/keel | src/main/java/com/harium/keel/effect/rotate/RotateOperation.java | RotateOperation.angle | public RotateOperation angle(double angle) {
this.angle = angle;
// Calculate cos and sin with negative angle
double angleRad = -angle * Math.PI / 180;
angleCos = Math.cos(angleRad);
angleSin = Math.sin(angleRad);
return this;
} | java | public RotateOperation angle(double angle) {
this.angle = angle;
// Calculate cos and sin with negative angle
double angleRad = -angle * Math.PI / 180;
angleCos = Math.cos(angleRad);
angleSin = Math.sin(angleRad);
return this;
} | [
"public",
"RotateOperation",
"angle",
"(",
"double",
"angle",
")",
"{",
"this",
".",
"angle",
"=",
"angle",
";",
"// Calculate cos and sin with negative angle",
"double",
"angleRad",
"=",
"-",
"angle",
"*",
"Math",
".",
"PI",
"/",
"180",
";",
"angleCos",
"=",
... | Set Angle.
@param angle Angle [0..360]. | [
"Set",
"Angle",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/rotate/RotateOperation.java#L35-L42 |
12,306 | Harium/keel | src/main/java/com/harium/keel/effect/rotate/RotateOperation.java | RotateOperation.fillColor | public RotateOperation fillColor(int red, int green, int blue) {
this.fillRed = red;
this.fillGreen = green;
this.fillBlue = blue;
return this;
} | java | public RotateOperation fillColor(int red, int green, int blue) {
this.fillRed = red;
this.fillGreen = green;
this.fillBlue = blue;
return this;
} | [
"public",
"RotateOperation",
"fillColor",
"(",
"int",
"red",
",",
"int",
"green",
",",
"int",
"blue",
")",
"{",
"this",
".",
"fillRed",
"=",
"red",
";",
"this",
".",
"fillGreen",
"=",
"green",
";",
"this",
".",
"fillBlue",
"=",
"blue",
";",
"return",
... | Set Fill color.
@param red Red channel's value.
@param green Green channel's value.
@param blue Blue channel's value. | [
"Set",
"Fill",
"color",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/rotate/RotateOperation.java#L70-L75 |
12,307 | Harium/keel | src/main/java/com/harium/keel/effect/helper/Curve.java | Curve.makeLut | public int[] makeLut() {
int numKnots = x.length;
float[] nx = new float[numKnots + 2];
float[] ny = new float[numKnots + 2];
System.arraycopy(x, 0, nx, 1, numKnots);
System.arraycopy(y, 0, ny, 1, numKnots);
nx[0] = nx[1];
ny[0] = ny[1];
nx[numKnots + 1] =... | java | public int[] makeLut() {
int numKnots = x.length;
float[] nx = new float[numKnots + 2];
float[] ny = new float[numKnots + 2];
System.arraycopy(x, 0, nx, 1, numKnots);
System.arraycopy(y, 0, ny, 1, numKnots);
nx[0] = nx[1];
ny[0] = ny[1];
nx[numKnots + 1] =... | [
"public",
"int",
"[",
"]",
"makeLut",
"(",
")",
"{",
"int",
"numKnots",
"=",
"x",
".",
"length",
";",
"float",
"[",
"]",
"nx",
"=",
"new",
"float",
"[",
"numKnots",
"+",
"2",
"]",
";",
"float",
"[",
"]",
"ny",
"=",
"new",
"float",
"[",
"numKnot... | Create LUT.
@return LUT. | [
"Create",
"LUT",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/helper/Curve.java#L206-L229 |
12,308 | Harium/keel | src/main/java/com/harium/keel/effect/helper/Curve.java | Curve.Spline | public static float Spline(float x, int numKnots, float[] knots) {
int span;
int numSpans = numKnots - 3;
float k0, k1, k2, k3;
float c0, c1, c2, c3;
if (numSpans < 1)
throw new IllegalArgumentException("Too few knots in spline");
x = x > 1 ? 1 : x;
... | java | public static float Spline(float x, int numKnots, float[] knots) {
int span;
int numSpans = numKnots - 3;
float k0, k1, k2, k3;
float c0, c1, c2, c3;
if (numSpans < 1)
throw new IllegalArgumentException("Too few knots in spline");
x = x > 1 ? 1 : x;
... | [
"public",
"static",
"float",
"Spline",
"(",
"float",
"x",
",",
"int",
"numKnots",
",",
"float",
"[",
"]",
"knots",
")",
"{",
"int",
"span",
";",
"int",
"numSpans",
"=",
"numKnots",
"-",
"3",
";",
"float",
"k0",
",",
"k1",
",",
"k2",
",",
"k3",
";... | compute a Catmull-Rom spline.
@param x the input parameter
@param numKnots the number of knots in the spline
@param knots the array of knots
@return the spline value | [
"compute",
"a",
"Catmull",
"-",
"Rom",
"spline",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/helper/Curve.java#L239-L267 |
12,309 | Harium/keel | src/main/java/com/harium/keel/effect/helper/Curve.java | Curve.Spline | public static float Spline(float x, int numKnots, int[] xknots, int[] yknots) {
int span;
int numSpans = numKnots - 3;
float k0, k1, k2, k3;
float c0, c1, c2, c3;
if (numSpans < 1)
throw new IllegalArgumentException("Too few knots in spline");
for (span = 0;... | java | public static float Spline(float x, int numKnots, int[] xknots, int[] yknots) {
int span;
int numSpans = numKnots - 3;
float k0, k1, k2, k3;
float c0, c1, c2, c3;
if (numSpans < 1)
throw new IllegalArgumentException("Too few knots in spline");
for (span = 0;... | [
"public",
"static",
"float",
"Spline",
"(",
"float",
"x",
",",
"int",
"numKnots",
",",
"int",
"[",
"]",
"xknots",
",",
"int",
"[",
"]",
"yknots",
")",
"{",
"int",
"span",
";",
"int",
"numSpans",
"=",
"numKnots",
"-",
"3",
";",
"float",
"k0",
",",
... | compute a Catmull-Rom spline, but with variable knot spacing.
@param x the input parameter
@param numKnots the number of knots in the spline
@param xknots the array of knot x values
@param yknots the array of knot y values
@return the spline value | [
"compute",
"a",
"Catmull",
"-",
"Rom",
"spline",
"but",
"with",
"variable",
"knot",
"spacing",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/helper/Curve.java#L278-L310 |
12,310 | skuzzle/jeve | jeve/src/main/java/de/skuzzle/jeve/EventPredicates.java | EventPredicates.withListenerClass | public static Predicate<Event<?, ?>> withListenerClass(
Class<? extends Listener> cls) {
if (cls == null) {
throw new IllegalArgumentException("cls is null");
}
return event -> event.getListenerClass() == cls;
} | java | public static Predicate<Event<?, ?>> withListenerClass(
Class<? extends Listener> cls) {
if (cls == null) {
throw new IllegalArgumentException("cls is null");
}
return event -> event.getListenerClass() == cls;
} | [
"public",
"static",
"Predicate",
"<",
"Event",
"<",
"?",
",",
"?",
">",
">",
"withListenerClass",
"(",
"Class",
"<",
"?",
"extends",
"Listener",
">",
"cls",
")",
"{",
"if",
"(",
"cls",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Creates a predicate that matches events for the given listener class.
@param cls The listener class to check for.
@return The predicate. | [
"Creates",
"a",
"predicate",
"that",
"matches",
"events",
"for",
"the",
"given",
"listener",
"class",
"."
] | 42cc18947c9c8596c34410336e4e375e9fcd7c47 | https://github.com/skuzzle/jeve/blob/42cc18947c9c8596c34410336e4e375e9fcd7c47/jeve/src/main/java/de/skuzzle/jeve/EventPredicates.java#L23-L29 |
12,311 | Harium/keel | src/main/java/com/harium/keel/util/CameraUtil.java | CameraUtil.fieldOfView | public static float fieldOfView(float focalLength, float sensorWidth) {
double fov = 2 * Math.atan(.5 * sensorWidth / focalLength);
return (float) Math.toDegrees(fov);
} | java | public static float fieldOfView(float focalLength, float sensorWidth) {
double fov = 2 * Math.atan(.5 * sensorWidth / focalLength);
return (float) Math.toDegrees(fov);
} | [
"public",
"static",
"float",
"fieldOfView",
"(",
"float",
"focalLength",
",",
"float",
"sensorWidth",
")",
"{",
"double",
"fov",
"=",
"2",
"*",
"Math",
".",
"atan",
"(",
".5",
"*",
"sensorWidth",
"/",
"focalLength",
")",
";",
"return",
"(",
"float",
")",... | Calculate the FOV of camera, using focalLength and sensorWidth
@param focalLength
@param sensorWidth
@return FOV | [
"Calculate",
"the",
"FOV",
"of",
"camera",
"using",
"focalLength",
"and",
"sensorWidth"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/util/CameraUtil.java#L24-L27 |
12,312 | Harium/keel | src/main/java/com/harium/keel/effect/GammaCorrection.java | GammaCorrection.gammaLUT | private static int[] gammaLUT(double gammaValue) {
int[] gammaLUT = new int[256];
for (int i = 0; i < gammaLUT.length; i++) {
gammaLUT[i] = (int) (255 * (Math.pow((double) i / (double) 255, gammaValue)));
}
return gammaLUT;
} | java | private static int[] gammaLUT(double gammaValue) {
int[] gammaLUT = new int[256];
for (int i = 0; i < gammaLUT.length; i++) {
gammaLUT[i] = (int) (255 * (Math.pow((double) i / (double) 255, gammaValue)));
}
return gammaLUT;
} | [
"private",
"static",
"int",
"[",
"]",
"gammaLUT",
"(",
"double",
"gammaValue",
")",
"{",
"int",
"[",
"]",
"gammaLUT",
"=",
"new",
"int",
"[",
"256",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"gammaLUT",
".",
"length",
";",
"i",
... | Create the gamma correction lookup table | [
"Create",
"the",
"gamma",
"correction",
"lookup",
"table"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/GammaCorrection.java#L50-L58 |
12,313 | Harium/keel | src/main/java/com/harium/keel/catalano/math/function/Beta.java | Beta.Log | public static double Log(double a, double b) {
return Gamma.Log(a) + Gamma.Log(b) - Gamma.Log(a + b);
} | java | public static double Log(double a, double b) {
return Gamma.Log(a) + Gamma.Log(b) - Gamma.Log(a + b);
} | [
"public",
"static",
"double",
"Log",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"return",
"Gamma",
".",
"Log",
"(",
"a",
")",
"+",
"Gamma",
".",
"Log",
"(",
"b",
")",
"-",
"Gamma",
".",
"Log",
"(",
"a",
"+",
"b",
")",
";",
"}"
] | Natural logarithm of the Beta function.
@param a Value.
@param b Value.
@return Result. | [
"Natural",
"logarithm",
"of",
"the",
"Beta",
"function",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/function/Beta.java#L60-L62 |
12,314 | Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java | FourierTransform.DFT | public static void DFT(ComplexNumber[] data, Direction direction) {
int n = data.length;
ComplexNumber[] c = new ComplexNumber[n];
// for each destination element
for (int i = 0; i < n; i++) {
c[i] = new ComplexNumber(0, 0);
double sumRe = 0;
... | java | public static void DFT(ComplexNumber[] data, Direction direction) {
int n = data.length;
ComplexNumber[] c = new ComplexNumber[n];
// for each destination element
for (int i = 0; i < n; i++) {
c[i] = new ComplexNumber(0, 0);
double sumRe = 0;
... | [
"public",
"static",
"void",
"DFT",
"(",
"ComplexNumber",
"[",
"]",
"data",
",",
"Direction",
"direction",
")",
"{",
"int",
"n",
"=",
"data",
".",
"length",
";",
"ComplexNumber",
"[",
"]",
"c",
"=",
"new",
"ComplexNumber",
"[",
"n",
"]",
";",
"// for ea... | 1-D Discrete Fourier Transform.
@param data Data to transform.
@param direction Transformation direction. | [
"1",
"-",
"D",
"Discrete",
"Fourier",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java#L84-L122 |
12,315 | Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java | FourierTransform.DFT2 | public static void DFT2(ComplexNumber[][] data, Direction direction) {
int n = data.length;
int m = data[0].length;
ComplexNumber[] row = new ComplexNumber[Math.max(m, n)];
for (int i = 0; i < n; i++) {
// copy row
for (int j = 0; j < n; j++)
... | java | public static void DFT2(ComplexNumber[][] data, Direction direction) {
int n = data.length;
int m = data[0].length;
ComplexNumber[] row = new ComplexNumber[Math.max(m, n)];
for (int i = 0; i < n; i++) {
// copy row
for (int j = 0; j < n; j++)
... | [
"public",
"static",
"void",
"DFT2",
"(",
"ComplexNumber",
"[",
"]",
"[",
"]",
"data",
",",
"Direction",
"direction",
")",
"{",
"int",
"n",
"=",
"data",
".",
"length",
";",
"int",
"m",
"=",
"data",
"[",
"0",
"]",
".",
"length",
";",
"ComplexNumber",
... | 2-D Discrete Fourier Transform.
@param data Data to transform.
@param direction Transformation direction. | [
"2",
"-",
"D",
"Discrete",
"Fourier",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java#L130-L160 |
12,316 | Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java | FourierTransform.FFT | public static void FFT(ComplexNumber[] data, Direction direction) {
double[] real = ComplexNumber.getReal(data);
double[] img = ComplexNumber.getImaginary(data);
if (direction == Direction.Forward)
FFT(real, img);
else
FFT(img, real);
if (direction ... | java | public static void FFT(ComplexNumber[] data, Direction direction) {
double[] real = ComplexNumber.getReal(data);
double[] img = ComplexNumber.getImaginary(data);
if (direction == Direction.Forward)
FFT(real, img);
else
FFT(img, real);
if (direction ... | [
"public",
"static",
"void",
"FFT",
"(",
"ComplexNumber",
"[",
"]",
"data",
",",
"Direction",
"direction",
")",
"{",
"double",
"[",
"]",
"real",
"=",
"ComplexNumber",
".",
"getReal",
"(",
"data",
")",
";",
"double",
"[",
"]",
"img",
"=",
"ComplexNumber",
... | 1-D Fast Fourier Transform.
@param data Data to transform.
@param direction Transformation direction. | [
"1",
"-",
"D",
"Fast",
"Fourier",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java#L168-L185 |
12,317 | Harium/keel | src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java | FourierTransform.FFT2 | public static void FFT2(ComplexNumber[][] data, Direction direction) {
int n = data.length;
int m = data[0].length;
//ComplexNumber[] row = new ComplexNumber[m];//Math.max(m, n)];
for (int i = 0; i < n; i++) {
// copy row
//for ( int j = 0; j < m; j++ )
... | java | public static void FFT2(ComplexNumber[][] data, Direction direction) {
int n = data.length;
int m = data[0].length;
//ComplexNumber[] row = new ComplexNumber[m];//Math.max(m, n)];
for (int i = 0; i < n; i++) {
// copy row
//for ( int j = 0; j < m; j++ )
... | [
"public",
"static",
"void",
"FFT2",
"(",
"ComplexNumber",
"[",
"]",
"[",
"]",
"data",
",",
"Direction",
"direction",
")",
"{",
"int",
"n",
"=",
"data",
".",
"length",
";",
"int",
"m",
"=",
"data",
"[",
"0",
"]",
".",
"length",
";",
"//ComplexNumber[]... | 2-D Fast Fourier Transform.
@param data Data to transform.
@param direction Transformation direction. | [
"2",
"-",
"D",
"Fast",
"Fourier",
"Transform",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/transform/FourierTransform.java#L193-L223 |
12,318 | Harium/keel | src/main/java/com/harium/keel/effect/neuroph/LetterSegmentation.java | LetterSegmentation.BFS | public ImageSource BFS(int startI, int startJ, /*String imageName*/ImageSource originalImage) {
LinkedList<Vector2i> queue = new LinkedList<>();
//=============================================================================
int gapX = 30;
int gapY = 30;
MatrixSource letter = ... | java | public ImageSource BFS(int startI, int startJ, /*String imageName*/ImageSource originalImage) {
LinkedList<Vector2i> queue = new LinkedList<>();
//=============================================================================
int gapX = 30;
int gapY = 30;
MatrixSource letter = ... | [
"public",
"ImageSource",
"BFS",
"(",
"int",
"startI",
",",
"int",
"startJ",
",",
"/*String imageName*/",
"ImageSource",
"originalImage",
")",
"{",
"LinkedList",
"<",
"Vector2i",
">",
"queue",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"//====================... | Breadth first search | [
"Breadth",
"first",
"search"
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/neuroph/LetterSegmentation.java#L60-L146 |
12,319 | Harium/keel | src/main/java/com/harium/keel/catalano/core/FloatPoint.java | FloatPoint.Subtract | public FloatPoint Subtract(FloatPoint point1, FloatPoint point2) {
FloatPoint result = new FloatPoint(point1);
result.Subtract(point2);
return result;
} | java | public FloatPoint Subtract(FloatPoint point1, FloatPoint point2) {
FloatPoint result = new FloatPoint(point1);
result.Subtract(point2);
return result;
} | [
"public",
"FloatPoint",
"Subtract",
"(",
"FloatPoint",
"point1",
",",
"FloatPoint",
"point2",
")",
"{",
"FloatPoint",
"result",
"=",
"new",
"FloatPoint",
"(",
"point1",
")",
";",
"result",
".",
"Subtract",
"(",
"point2",
")",
";",
"return",
"result",
";",
... | Subtracts values of two points.
@param point1 FloatPoint.
@param point2 FloatPoint.
@return A new FloatPoint with the subtract operation. | [
"Subtracts",
"values",
"of",
"two",
"points",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/FloatPoint.java#L170-L174 |
12,320 | Harium/keel | src/main/java/com/harium/keel/catalano/core/FloatPoint.java | FloatPoint.Divide | public FloatPoint Divide(FloatPoint point1, FloatPoint point2) {
FloatPoint result = new FloatPoint(point1);
result.Divide(point2);
return result;
} | java | public FloatPoint Divide(FloatPoint point1, FloatPoint point2) {
FloatPoint result = new FloatPoint(point1);
result.Divide(point2);
return result;
} | [
"public",
"FloatPoint",
"Divide",
"(",
"FloatPoint",
"point1",
",",
"FloatPoint",
"point2",
")",
"{",
"FloatPoint",
"result",
"=",
"new",
"FloatPoint",
"(",
"point1",
")",
";",
"result",
".",
"Divide",
"(",
"point2",
")",
";",
"return",
"result",
";",
"}"
... | Divide values of two points.
@param point1 FloatPoint.
@param point2 FloatPoint.
@return A new FloatPoint with the division operation. | [
"Divide",
"values",
"of",
"two",
"points",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/core/FloatPoint.java#L236-L240 |
12,321 | Harium/keel | src/main/java/com/harium/keel/effect/LevelsCurve.java | LevelsCurve.setCurve | public void setCurve(Curve curveRed, Curve curveGreen, Curve curveBlue) {
this.curveRed = curveRed;
this.curveGreen = curveGreen;
this.curveBlue = curveBlue;
} | java | public void setCurve(Curve curveRed, Curve curveGreen, Curve curveBlue) {
this.curveRed = curveRed;
this.curveGreen = curveGreen;
this.curveBlue = curveBlue;
} | [
"public",
"void",
"setCurve",
"(",
"Curve",
"curveRed",
",",
"Curve",
"curveGreen",
",",
"Curve",
"curveBlue",
")",
"{",
"this",
".",
"curveRed",
"=",
"curveRed",
";",
"this",
".",
"curveGreen",
"=",
"curveGreen",
";",
"this",
".",
"curveBlue",
"=",
"curve... | Set curves.
@param curveRed Red curve.
@param curveGreen Green curve.
@param curveBlue Blue curve. | [
"Set",
"curves",
"."
] | 0369ae674f9e664bccc5f9e161ae7e7a3b949a1e | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/LevelsCurve.java#L104-L108 |
12,322 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java | ReframingResponseObserver.deliver | private void deliver() {
try {
deliverUnsafe();
} catch (Throwable t) {
// This should never happen. If does, it means we are in an inconsistent state and should
// close the stream and further processing should be prevented. This is accomplished by
// purposefully leaving the lock non-z... | java | private void deliver() {
try {
deliverUnsafe();
} catch (Throwable t) {
// This should never happen. If does, it means we are in an inconsistent state and should
// close the stream and further processing should be prevented. This is accomplished by
// purposefully leaving the lock non-z... | [
"private",
"void",
"deliver",
"(",
")",
"{",
"try",
"{",
"deliverUnsafe",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"// This should never happen. If does, it means we are in an inconsistent state and should",
"// close the stream and further processing sho... | Tries to kick off the delivery loop, wrapping it in error handling. | [
"Tries",
"to",
"kick",
"off",
"the",
"delivery",
"loop",
"wrapping",
"it",
"in",
"error",
"handling",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java#L238-L252 |
12,323 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java | ReframingResponseObserver.maybeFinish | private boolean maybeFinish() {
// Check for cancellations
Throwable localError = this.cancellation.get();
if (localError != null) {
finished = true;
outerResponseObserver.onError(localError);
return true;
}
// Check for upstream termination and exhaustion of local buffers
if... | java | private boolean maybeFinish() {
// Check for cancellations
Throwable localError = this.cancellation.get();
if (localError != null) {
finished = true;
outerResponseObserver.onError(localError);
return true;
}
// Check for upstream termination and exhaustion of local buffers
if... | [
"private",
"boolean",
"maybeFinish",
"(",
")",
"{",
"// Check for cancellations",
"Throwable",
"localError",
"=",
"this",
".",
"cancellation",
".",
"get",
"(",
")",
";",
"if",
"(",
"localError",
"!=",
"null",
")",
"{",
"finished",
"=",
"true",
";",
"outerRes... | Completes the outer observer if appropriate.
<p>Grounds for completion:
<ul>
<li>Caller cancelled the stream
<li>Upstream has been exhausted and there is no hope of completing another frame.
</ul>
<p>Upon upstream exhaustion, the outer observer will be notified via onComplete only if all
buffers have been consumed. ... | [
"Completes",
"the",
"outer",
"observer",
"if",
"appropriate",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/reframing/ReframingResponseObserver.java#L352-L378 |
12,324 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/CompanyServiceClient.java | CompanyServiceClient.updateCompany | public final Company updateCompany(Company company) {
UpdateCompanyRequest request = UpdateCompanyRequest.newBuilder().setCompany(company).build();
return updateCompany(request);
} | java | public final Company updateCompany(Company company) {
UpdateCompanyRequest request = UpdateCompanyRequest.newBuilder().setCompany(company).build();
return updateCompany(request);
} | [
"public",
"final",
"Company",
"updateCompany",
"(",
"Company",
"company",
")",
"{",
"UpdateCompanyRequest",
"request",
"=",
"UpdateCompanyRequest",
".",
"newBuilder",
"(",
")",
".",
"setCompany",
"(",
"company",
")",
".",
"build",
"(",
")",
";",
"return",
"upd... | Updates specified company.
<p>Sample code:
<pre><code>
try (CompanyServiceClient companyServiceClient = CompanyServiceClient.create()) {
Company company = Company.newBuilder().build();
Company response = companyServiceClient.updateCompany(company);
}
</code></pre>
@param company Required.
<p>The company resource to ... | [
"Updates",
"specified",
"company",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-talent/src/main/java/com/google/cloud/talent/v4beta1/CompanyServiceClient.java#L389-L393 |
12,325 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesClient.java | EntityTypesClient.createEntityType | public final EntityType createEntityType(
String parent, EntityType entityType, String languageCode) {
CreateEntityTypeRequest request =
CreateEntityTypeRequest.newBuilder()
.setParent(parent)
.setEntityType(entityType)
.setLanguageCode(languageCode)
.b... | java | public final EntityType createEntityType(
String parent, EntityType entityType, String languageCode) {
CreateEntityTypeRequest request =
CreateEntityTypeRequest.newBuilder()
.setParent(parent)
.setEntityType(entityType)
.setLanguageCode(languageCode)
.b... | [
"public",
"final",
"EntityType",
"createEntityType",
"(",
"String",
"parent",
",",
"EntityType",
"entityType",
",",
"String",
"languageCode",
")",
"{",
"CreateEntityTypeRequest",
"request",
"=",
"CreateEntityTypeRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",... | Creates an entity type in the specified agent.
<p>Sample code:
<pre><code>
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.of("[PROJECT]");
EntityType entityType = EntityType.newBuilder().build();
String languageCode = "";
EntityType response = entit... | [
"Creates",
"an",
"entity",
"type",
"in",
"the",
"specified",
"agent",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesClient.java#L663-L673 |
12,326 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesClient.java | EntityTypesClient.batchUpdateEntitiesAsync | @BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Empty, Struct> batchUpdateEntitiesAsync(
BatchUpdateEntitiesRequest request) {
return batchUpdateEntitiesOperationCallable().futureCall(request);
} | java | @BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Empty, Struct> batchUpdateEntitiesAsync(
BatchUpdateEntitiesRequest request) {
return batchUpdateEntitiesOperationCallable().futureCall(request);
} | [
"@",
"BetaApi",
"(",
"\"The surface for long-running operations is not stable yet and may change in the future.\"",
")",
"public",
"final",
"OperationFuture",
"<",
"Empty",
",",
"Struct",
">",
"batchUpdateEntitiesAsync",
"(",
"BatchUpdateEntitiesRequest",
"request",
")",
"{",
"... | Updates or creates multiple entities in the specified entity type. This method does not affect
entities in the entity type that aren't explicitly specified in the request.
<p>Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
<p>Sample code:
<pre><code>
try (EntityTypesClient entityTypesClien... | [
"Updates",
"or",
"creates",
"multiple",
"entities",
"in",
"the",
"specified",
"entity",
"type",
".",
"This",
"method",
"does",
"not",
"affect",
"entities",
"in",
"the",
"entity",
"type",
"that",
"aren",
"t",
"explicitly",
"specified",
"in",
"the",
"request",
... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/EntityTypesClient.java#L1555-L1560 |
12,327 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java | FieldValueList.get | public FieldValue get(String name) {
if (schema == null) {
throw new UnsupportedOperationException(
"Retrieving field value by name is not supported when there is no fields schema provided");
}
return get(schema.getIndex(name));
} | java | public FieldValue get(String name) {
if (schema == null) {
throw new UnsupportedOperationException(
"Retrieving field value by name is not supported when there is no fields schema provided");
}
return get(schema.getIndex(name));
} | [
"public",
"FieldValue",
"get",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"schema",
"==",
"null",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Retrieving field value by name is not supported when there is no fields schema provided\"",
")",
";",
"}",... | Gets field value by index.
@param name field name (defined in schema)
@throws IllegalArgumentException if schema is not provided or if {@code name} was not found in
the schema | [
"Gets",
"field",
"value",
"by",
"index",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldValueList.java#L67-L73 |
12,328 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java | DiskTypeId.of | public static DiskTypeId of(ZoneId zoneId, String type) {
return new DiskTypeId(zoneId.getProject(), zoneId.getZone(), type);
} | java | public static DiskTypeId of(ZoneId zoneId, String type) {
return new DiskTypeId(zoneId.getProject(), zoneId.getZone(), type);
} | [
"public",
"static",
"DiskTypeId",
"of",
"(",
"ZoneId",
"zoneId",
",",
"String",
"type",
")",
"{",
"return",
"new",
"DiskTypeId",
"(",
"zoneId",
".",
"getProject",
"(",
")",
",",
"zoneId",
".",
"getZone",
"(",
")",
",",
"type",
")",
";",
"}"
] | Returns a disk type identity given the zone identity and the disk type name. | [
"Returns",
"a",
"disk",
"type",
"identity",
"given",
"the",
"zone",
"identity",
"and",
"the",
"disk",
"type",
"name",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java#L111-L113 |
12,329 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java | DiskTypeId.of | public static DiskTypeId of(String zone, String type) {
return of(ZoneId.of(null, zone), type);
} | java | public static DiskTypeId of(String zone, String type) {
return of(ZoneId.of(null, zone), type);
} | [
"public",
"static",
"DiskTypeId",
"of",
"(",
"String",
"zone",
",",
"String",
"type",
")",
"{",
"return",
"of",
"(",
"ZoneId",
".",
"of",
"(",
"null",
",",
"zone",
")",
",",
"type",
")",
";",
"}"
] | Returns a disk type identity given the zone and disk type names. | [
"Returns",
"a",
"disk",
"type",
"identity",
"given",
"the",
"zone",
"and",
"disk",
"type",
"names",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java#L116-L118 |
12,330 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java | DiskTypeId.of | public static DiskTypeId of(String project, String zone, String type) {
return of(ZoneId.of(project, zone), type);
} | java | public static DiskTypeId of(String project, String zone, String type) {
return of(ZoneId.of(project, zone), type);
} | [
"public",
"static",
"DiskTypeId",
"of",
"(",
"String",
"project",
",",
"String",
"zone",
",",
"String",
"type",
")",
"{",
"return",
"of",
"(",
"ZoneId",
".",
"of",
"(",
"project",
",",
"zone",
")",
",",
"type",
")",
";",
"}"
] | Returns a disk type identity given project disk, zone and disk type names. | [
"Returns",
"a",
"disk",
"type",
"identity",
"given",
"project",
"disk",
"zone",
"and",
"disk",
"type",
"names",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/DiskTypeId.java#L121-L123 |
12,331 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GCRules.java | GCRules.maxAge | public DurationRule maxAge(long maxAge, TimeUnit timeUnit) {
return maxAge(Duration.ofNanos(TimeUnit.NANOSECONDS.convert(maxAge, timeUnit)));
} | java | public DurationRule maxAge(long maxAge, TimeUnit timeUnit) {
return maxAge(Duration.ofNanos(TimeUnit.NANOSECONDS.convert(maxAge, timeUnit)));
} | [
"public",
"DurationRule",
"maxAge",
"(",
"long",
"maxAge",
",",
"TimeUnit",
"timeUnit",
")",
"{",
"return",
"maxAge",
"(",
"Duration",
".",
"ofNanos",
"(",
"TimeUnit",
".",
"NANOSECONDS",
".",
"convert",
"(",
"maxAge",
",",
"timeUnit",
")",
")",
")",
";",
... | Creates a new instance of the DurationRule
@param maxAge - maximum age of the cell to keep
@param timeUnit - timeunit for the age | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"DurationRule"
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/GCRules.java#L66-L68 |
12,332 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java | SpannerImpl.runWithRetries | static <T> T runWithRetries(Callable<T> callable) {
// Use same backoff setting as abort, somewhat arbitrarily.
Span span = tracer.getCurrentSpan();
ExponentialBackOff backOff = newBackOff();
Context context = Context.current();
int attempt = 0;
while (true) {
attempt++;
try {
... | java | static <T> T runWithRetries(Callable<T> callable) {
// Use same backoff setting as abort, somewhat arbitrarily.
Span span = tracer.getCurrentSpan();
ExponentialBackOff backOff = newBackOff();
Context context = Context.current();
int attempt = 0;
while (true) {
attempt++;
try {
... | [
"static",
"<",
"T",
">",
"T",
"runWithRetries",
"(",
"Callable",
"<",
"T",
">",
"callable",
")",
"{",
"// Use same backoff setting as abort, somewhat arbitrarily.",
"Span",
"span",
"=",
"tracer",
".",
"getCurrentSpan",
"(",
")",
";",
"ExponentialBackOff",
"backOff",... | Helper to execute some work, retrying with backoff on retryable errors.
<p>TODO: Consider replacing with RetryHelper from gcloud-core. | [
"Helper",
"to",
"execute",
"some",
"work",
"retrying",
"with",
"backoff",
"on",
"retryable",
"errors",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerImpl.java#L164-L194 |
12,333 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java | HttpTransportOptions.getHttpRequestInitializer | public HttpRequestInitializer getHttpRequestInitializer(
final ServiceOptions<?, ?> serviceOptions) {
Credentials scopedCredentials = serviceOptions.getScopedCredentials();
final HttpRequestInitializer delegate =
scopedCredentials != null && scopedCredentials != NoCredentials.getInstance()
... | java | public HttpRequestInitializer getHttpRequestInitializer(
final ServiceOptions<?, ?> serviceOptions) {
Credentials scopedCredentials = serviceOptions.getScopedCredentials();
final HttpRequestInitializer delegate =
scopedCredentials != null && scopedCredentials != NoCredentials.getInstance()
... | [
"public",
"HttpRequestInitializer",
"getHttpRequestInitializer",
"(",
"final",
"ServiceOptions",
"<",
"?",
",",
"?",
">",
"serviceOptions",
")",
"{",
"Credentials",
"scopedCredentials",
"=",
"serviceOptions",
".",
"getScopedCredentials",
"(",
")",
";",
"final",
"HttpR... | Returns a request initializer responsible for initializing requests according to service
options. | [
"Returns",
"a",
"request",
"initializer",
"responsible",
"for",
"initializing",
"requests",
"according",
"to",
"service",
"options",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-core-http/src/main/java/com/google/cloud/http/HttpTransportOptions.java#L143-L171 |
12,334 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java | Query.shard | public List<Query> shard(SortedSet<ByteString> splitPoints) {
Preconditions.checkState(builder.getRowsLimit() == 0, "Can't shard a query with a row limit");
List<RowSet> shardedRowSets = RowSetUtil.shard(builder.getRows(), splitPoints);
List<Query> shards = Lists.newArrayListWithCapacity(shardedRowSets.siz... | java | public List<Query> shard(SortedSet<ByteString> splitPoints) {
Preconditions.checkState(builder.getRowsLimit() == 0, "Can't shard a query with a row limit");
List<RowSet> shardedRowSets = RowSetUtil.shard(builder.getRows(), splitPoints);
List<Query> shards = Lists.newArrayListWithCapacity(shardedRowSets.siz... | [
"public",
"List",
"<",
"Query",
">",
"shard",
"(",
"SortedSet",
"<",
"ByteString",
">",
"splitPoints",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"builder",
".",
"getRowsLimit",
"(",
")",
"==",
"0",
",",
"\"Can't shard a query with a row limit\"",
")",
... | Split this query into multiple queries that logically combine into this query. This is intended
to be used by map reduce style frameworks like Beam to split a query across multiple workers.
<p>Expected Usage:
<pre>{@code
List<ByteString> splitPoints = ...;
List<Query> queryShards = myQuery.shard(splitPoints);
List<Ap... | [
"Split",
"this",
"query",
"into",
"multiple",
"queries",
"that",
"logically",
"combine",
"into",
"this",
"query",
".",
"This",
"is",
"intended",
"to",
"be",
"used",
"by",
"map",
"reduce",
"style",
"frameworks",
"like",
"Beam",
"to",
"split",
"a",
"query",
... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/models/Query.java#L225-L239 |
12,335 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java | MachineTypeId.of | public static MachineTypeId of(String zone, String type) {
return new MachineTypeId(null, zone, type);
} | java | public static MachineTypeId of(String zone, String type) {
return new MachineTypeId(null, zone, type);
} | [
"public",
"static",
"MachineTypeId",
"of",
"(",
"String",
"zone",
",",
"String",
"type",
")",
"{",
"return",
"new",
"MachineTypeId",
"(",
"null",
",",
"zone",
",",
"type",
")",
";",
"}"
] | Returns a machine type identity given the zone and type names. | [
"Returns",
"a",
"machine",
"type",
"identity",
"given",
"the",
"zone",
"and",
"type",
"names",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java#L111-L113 |
12,336 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java | MachineTypeId.of | public static MachineTypeId of(String project, String zone, String type) {
return new MachineTypeId(project, zone, type);
} | java | public static MachineTypeId of(String project, String zone, String type) {
return new MachineTypeId(project, zone, type);
} | [
"public",
"static",
"MachineTypeId",
"of",
"(",
"String",
"project",
",",
"String",
"zone",
",",
"String",
"type",
")",
"{",
"return",
"new",
"MachineTypeId",
"(",
"project",
",",
"zone",
",",
"type",
")",
";",
"}"
] | Returns a machine type identity given project, zone and type names. | [
"Returns",
"a",
"machine",
"type",
"identity",
"given",
"project",
"zone",
"and",
"type",
"names",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/MachineTypeId.java#L116-L118 |
12,337 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java | BlobInfo.getMd5ToHexString | public String getMd5ToHexString() {
if (md5 == null) {
return null;
}
byte[] decodedMd5 = BaseEncoding.base64().decode(md5);
StringBuilder stringBuilder = new StringBuilder();
for (byte b : decodedMd5) {
stringBuilder.append(String.format("%02x", b & 0xff));
}
return stringBuilde... | java | public String getMd5ToHexString() {
if (md5 == null) {
return null;
}
byte[] decodedMd5 = BaseEncoding.base64().decode(md5);
StringBuilder stringBuilder = new StringBuilder();
for (byte b : decodedMd5) {
stringBuilder.append(String.format("%02x", b & 0xff));
}
return stringBuilde... | [
"public",
"String",
"getMd5ToHexString",
"(",
")",
"{",
"if",
"(",
"md5",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"byte",
"[",
"]",
"decodedMd5",
"=",
"BaseEncoding",
".",
"base64",
"(",
")",
".",
"decode",
"(",
"md5",
")",
";",
"StringBu... | Returns the MD5 hash of blob's data decoded to string.
@see <a href="https://cloud.google.com/storage/docs/hashes-etags#_JSONAPI">Hashes and ETags:
Best Practices</a> | [
"Returns",
"the",
"MD5",
"hash",
"of",
"blob",
"s",
"data",
"decoded",
"to",
"string",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java#L730-L740 |
12,338 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java | BlobInfo.getMetadata | public Map<String, String> getMetadata() {
return metadata == null || Data.isNull(metadata) ? null : Collections.unmodifiableMap(metadata);
} | java | public Map<String, String> getMetadata() {
return metadata == null || Data.isNull(metadata) ? null : Collections.unmodifiableMap(metadata);
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getMetadata",
"(",
")",
"{",
"return",
"metadata",
"==",
"null",
"||",
"Data",
".",
"isNull",
"(",
"metadata",
")",
"?",
"null",
":",
"Collections",
".",
"unmodifiableMap",
"(",
"metadata",
")",
";",
... | Returns blob's user provided metadata. | [
"Returns",
"blob",
"s",
"user",
"provided",
"metadata",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/BlobInfo.java#L780-L782 |
12,339 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java | NotificationChannelServiceClient.updateNotificationChannel | public final NotificationChannel updateNotificationChannel(
FieldMask updateMask, NotificationChannel notificationChannel) {
UpdateNotificationChannelRequest request =
UpdateNotificationChannelRequest.newBuilder()
.setUpdateMask(updateMask)
.setNotificationChannel(notification... | java | public final NotificationChannel updateNotificationChannel(
FieldMask updateMask, NotificationChannel notificationChannel) {
UpdateNotificationChannelRequest request =
UpdateNotificationChannelRequest.newBuilder()
.setUpdateMask(updateMask)
.setNotificationChannel(notification... | [
"public",
"final",
"NotificationChannel",
"updateNotificationChannel",
"(",
"FieldMask",
"updateMask",
",",
"NotificationChannel",
"notificationChannel",
")",
"{",
"UpdateNotificationChannelRequest",
"request",
"=",
"UpdateNotificationChannelRequest",
".",
"newBuilder",
"(",
")... | Updates a notification channel. Fields not specified in the field mask remain unchanged.
<p>Sample code:
<pre><code>
try (NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.create()) {
FieldMask updateMask = FieldMask.newBuilder().build();
NotificationChannel notifica... | [
"Updates",
"a",
"notification",
"channel",
".",
"Fields",
"not",
"specified",
"in",
"the",
"field",
"mask",
"remain",
"unchanged",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-monitoring/src/main/java/com/google/cloud/monitoring/v3/NotificationChannelServiceClient.java#L824-L833 |
12,340 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java | JobControllerClient.submitJob | public final Job submitJob(String projectId, String region, Job job) {
SubmitJobRequest request =
SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build();
return submitJob(request);
} | java | public final Job submitJob(String projectId, String region, Job job) {
SubmitJobRequest request =
SubmitJobRequest.newBuilder().setProjectId(projectId).setRegion(region).setJob(job).build();
return submitJob(request);
} | [
"public",
"final",
"Job",
"submitJob",
"(",
"String",
"projectId",
",",
"String",
"region",
",",
"Job",
"job",
")",
"{",
"SubmitJobRequest",
"request",
"=",
"SubmitJobRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",
"se... | Submits a job to a cluster.
<p>Sample code:
<pre><code>
try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
String projectId = "";
String region = "";
Job job = Job.newBuilder().build();
Job response = jobControllerClient.submitJob(projectId, region, job);
}
</code></pre>
@param projectId ... | [
"Submits",
"a",
"job",
"to",
"a",
"cluster",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java#L179-L184 |
12,341 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java | JobControllerClient.getJob | public final Job getJob(String projectId, String region, String jobId) {
GetJobRequest request =
GetJobRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setJobId(jobId)
.build();
return getJob(request);
} | java | public final Job getJob(String projectId, String region, String jobId) {
GetJobRequest request =
GetJobRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setJobId(jobId)
.build();
return getJob(request);
} | [
"public",
"final",
"Job",
"getJob",
"(",
"String",
"projectId",
",",
"String",
"region",
",",
"String",
"jobId",
")",
"{",
"GetJobRequest",
"request",
"=",
"GetJobRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",
"setReg... | Gets the resource representation for a job in a project.
<p>Sample code:
<pre><code>
try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
String projectId = "";
String region = "";
String jobId = "";
Job response = jobControllerClient.getJob(projectId, region, jobId);
}
</code></pre>
@param... | [
"Gets",
"the",
"resource",
"representation",
"for",
"a",
"job",
"in",
"a",
"project",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java#L259-L268 |
12,342 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java | JobControllerClient.deleteJob | public final void deleteJob(String projectId, String region, String jobId) {
DeleteJobRequest request =
DeleteJobRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setJobId(jobId)
.build();
deleteJob(request);
} | java | public final void deleteJob(String projectId, String region, String jobId) {
DeleteJobRequest request =
DeleteJobRequest.newBuilder()
.setProjectId(projectId)
.setRegion(region)
.setJobId(jobId)
.build();
deleteJob(request);
} | [
"public",
"final",
"void",
"deleteJob",
"(",
"String",
"projectId",
",",
"String",
"region",
",",
"String",
"jobId",
")",
"{",
"DeleteJobRequest",
"request",
"=",
"DeleteJobRequest",
".",
"newBuilder",
"(",
")",
".",
"setProjectId",
"(",
"projectId",
")",
".",... | Deletes the job from the project. If the job is active, the delete fails, and the response
returns `FAILED_PRECONDITION`.
<p>Sample code:
<pre><code>
try (JobControllerClient jobControllerClient = JobControllerClient.create()) {
String projectId = "";
String region = "";
String jobId = "";
jobControllerClient.deleteJ... | [
"Deletes",
"the",
"job",
"from",
"the",
"project",
".",
"If",
"the",
"job",
"is",
"active",
"the",
"delete",
"fails",
"and",
"the",
"response",
"returns",
"FAILED_PRECONDITION",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dataproc/src/main/java/com/google/cloud/dataproc/v1/JobControllerClient.java#L647-L656 |
12,343 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldList.java | FieldList.getIndex | public int getIndex(String name) {
Integer index = nameIndex.get(name);
if (index == null) {
throw new IllegalArgumentException("Field with name '" + name + "' was not found");
}
return index;
} | java | public int getIndex(String name) {
Integer index = nameIndex.get(name);
if (index == null) {
throw new IllegalArgumentException("Field with name '" + name + "' was not found");
}
return index;
} | [
"public",
"int",
"getIndex",
"(",
"String",
"name",
")",
"{",
"Integer",
"index",
"=",
"nameIndex",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"index",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field with name '\"",
"+"... | Get schema field's index by name.
@param name field (column) name | [
"Get",
"schema",
"field",
"s",
"index",
"by",
"name",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/FieldList.java#L75-L81 |
12,344 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TimestampBound.java | TimestampBound.ofReadTimestamp | public static TimestampBound ofReadTimestamp(Timestamp timestamp) {
return new TimestampBound(Mode.READ_TIMESTAMP, checkNotNull(timestamp), null);
} | java | public static TimestampBound ofReadTimestamp(Timestamp timestamp) {
return new TimestampBound(Mode.READ_TIMESTAMP, checkNotNull(timestamp), null);
} | [
"public",
"static",
"TimestampBound",
"ofReadTimestamp",
"(",
"Timestamp",
"timestamp",
")",
"{",
"return",
"new",
"TimestampBound",
"(",
"Mode",
".",
"READ_TIMESTAMP",
",",
"checkNotNull",
"(",
"timestamp",
")",
",",
"null",
")",
";",
"}"
] | Returns a timestamp bound that will perform reads and queries at the given timestamp. Unlike
other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp
always returns the same data. If the timestamp is in the future, the read will block until the
specified timestamp, modulo the read'... | [
"Returns",
"a",
"timestamp",
"bound",
"that",
"will",
"perform",
"reads",
"and",
"queries",
"at",
"the",
"given",
"timestamp",
".",
"Unlike",
"other",
"modes",
"reads",
"at",
"a",
"specific",
"timestamp",
"are",
"repeatable",
";",
"the",
"same",
"read",
"at"... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TimestampBound.java#L152-L154 |
12,345 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TimestampBound.java | TimestampBound.ofExactStaleness | public static TimestampBound ofExactStaleness(long num, TimeUnit units) {
checkStaleness(num);
return new TimestampBound(Mode.EXACT_STALENESS, null, createDuration(num, units));
} | java | public static TimestampBound ofExactStaleness(long num, TimeUnit units) {
checkStaleness(num);
return new TimestampBound(Mode.EXACT_STALENESS, null, createDuration(num, units));
} | [
"public",
"static",
"TimestampBound",
"ofExactStaleness",
"(",
"long",
"num",
",",
"TimeUnit",
"units",
")",
"{",
"checkStaleness",
"(",
"num",
")",
";",
"return",
"new",
"TimestampBound",
"(",
"Mode",
".",
"EXACT_STALENESS",
",",
"null",
",",
"createDuration",
... | Returns a timestamp bound that will perform reads and queries at an exact staleness. The
timestamp is chosen soon after the read is started.
<p>Guarantees that all writes that have committed more than the specified number of seconds ago
are visible. Because Cloud Spanner chooses the exact timestamp, this mode works ev... | [
"Returns",
"a",
"timestamp",
"bound",
"that",
"will",
"perform",
"reads",
"and",
"queries",
"at",
"an",
"exact",
"staleness",
".",
"The",
"timestamp",
"is",
"chosen",
"soon",
"after",
"the",
"read",
"is",
"started",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/TimestampBound.java#L180-L183 |
12,346 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Date.java | Date.toJavaUtilDate | public static java.util.Date toJavaUtilDate(Date date) {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
// Calender.MONTH starts from 0 while G C date starts from 1
cal.set(d... | java | public static java.util.Date toJavaUtilDate(Date date) {
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
// Calender.MONTH starts from 0 while G C date starts from 1
cal.set(d... | [
"public",
"static",
"java",
".",
"util",
".",
"Date",
"toJavaUtilDate",
"(",
"Date",
"date",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"set",
"(",
"Calendar",
".",
"HOUR_OF_DAY",
",",
"0",
")",
";",
... | Convert a Google Date to a Java Util Date.
@param date the date of the Google Date.
@return java.util.Date | [
"Convert",
"a",
"Google",
"Date",
"to",
"a",
"Java",
"Util",
"Date",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Date.java#L78-L87 |
12,347 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Date.java | Date.fromJavaUtilDate | public static Date fromJavaUtilDate(java.util.Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
// Calender.MONTH starts from 0 while G C date st... | java | public static Date fromJavaUtilDate(java.util.Date date) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
// Calender.MONTH starts from 0 while G C date st... | [
"public",
"static",
"Date",
"fromJavaUtilDate",
"(",
"java",
".",
"util",
".",
"Date",
"date",
")",
"{",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal",
".",
"setTime",
"(",
"date",
")",
";",
"cal",
".",
"set",
"(",
"Cal... | Convert a Java Util Date to a Google Date.
@param date the date of the java.util.Date
@return Google Java Date | [
"Convert",
"a",
"Java",
"Util",
"Date",
"to",
"a",
"Google",
"Date",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-core/src/main/java/com/google/cloud/Date.java#L95-L105 |
12,348 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java | GrafeasV1Beta1Client.createNote | public final Note createNote(ProjectName parent, String noteId, Note note) {
CreateNoteRequest request =
CreateNoteRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setNoteId(noteId)
.setNote(note)
.build();
return createNote(req... | java | public final Note createNote(ProjectName parent, String noteId, Note note) {
CreateNoteRequest request =
CreateNoteRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setNoteId(noteId)
.setNote(note)
.build();
return createNote(req... | [
"public",
"final",
"Note",
"createNote",
"(",
"ProjectName",
"parent",
",",
"String",
"noteId",
",",
"Note",
"note",
")",
"{",
"CreateNoteRequest",
"request",
"=",
"CreateNoteRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent",
"==",
"null",... | Creates a new note.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
String noteId = "";
Note note = Note.newBuilder().build();
Note response = grafeasV1Beta1Client.createNote(parent, noteId, note);
}
</code... | [
"Creates",
"a",
"new",
"note",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java#L1287-L1296 |
12,349 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java | GrafeasV1Beta1Client.batchCreateNotes | public final BatchCreateNotesResponse batchCreateNotes(
ProjectName parent, Map<String, Note> notes) {
BatchCreateNotesRequest request =
BatchCreateNotesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.putAllNotes(notes)
.build();
ret... | java | public final BatchCreateNotesResponse batchCreateNotes(
ProjectName parent, Map<String, Note> notes) {
BatchCreateNotesRequest request =
BatchCreateNotesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.putAllNotes(notes)
.build();
ret... | [
"public",
"final",
"BatchCreateNotesResponse",
"batchCreateNotes",
"(",
"ProjectName",
"parent",
",",
"Map",
"<",
"String",
",",
"Note",
">",
"notes",
")",
"{",
"BatchCreateNotesRequest",
"request",
"=",
"BatchCreateNotesRequest",
".",
"newBuilder",
"(",
")",
".",
... | Creates new notes in batch.
<p>Sample code:
<pre><code>
try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Map<String, Note> notes = new HashMap<>();
BatchCreateNotesResponse response = grafeasV1Beta1Client.batchCreateNotes(p... | [
"Creates",
"new",
"notes",
"in",
"batch",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java#L1398-L1407 |
12,350 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/ResourcePath.java | ResourcePath.create | static ResourcePath create(DatabaseRootName databaseName, ImmutableList<String> segments) {
return new AutoValue_ResourcePath(segments, databaseName);
} | java | static ResourcePath create(DatabaseRootName databaseName, ImmutableList<String> segments) {
return new AutoValue_ResourcePath(segments, databaseName);
} | [
"static",
"ResourcePath",
"create",
"(",
"DatabaseRootName",
"databaseName",
",",
"ImmutableList",
"<",
"String",
">",
"segments",
")",
"{",
"return",
"new",
"AutoValue_ResourcePath",
"(",
"segments",
",",
"databaseName",
")",
";",
"}"
] | Creates a new Path.
@param databaseName The Firestore database name.
@param segments The segments of the path relative to the root collections. | [
"Creates",
"a",
"new",
"Path",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/ResourcePath.java#L37-L39 |
12,351 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/ResourcePath.java | ResourcePath.create | static ResourcePath create(String resourceName) {
String[] parts = resourceName.split("/");
if (parts.length >= 6 && parts[0].equals("projects") && parts[2].equals("databases")) {
String[] path = Arrays.copyOfRange(parts, 5, parts.length);
return create(
DatabaseRootName.of(parts[1], part... | java | static ResourcePath create(String resourceName) {
String[] parts = resourceName.split("/");
if (parts.length >= 6 && parts[0].equals("projects") && parts[2].equals("databases")) {
String[] path = Arrays.copyOfRange(parts, 5, parts.length);
return create(
DatabaseRootName.of(parts[1], part... | [
"static",
"ResourcePath",
"create",
"(",
"String",
"resourceName",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"resourceName",
".",
"split",
"(",
"\"/\"",
")",
";",
"if",
"(",
"parts",
".",
"length",
">=",
"6",
"&&",
"parts",
"[",
"0",
"]",
".",
"equ... | Create a new Path from its string representation.
@param resourceName The Firestore resource name of this path. | [
"Create",
"a",
"new",
"Path",
"from",
"its",
"string",
"representation",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/ResourcePath.java#L55-L66 |
12,352 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/ResourcePath.java | ResourcePath.getName | String getName() {
String path = getPath();
if (path.isEmpty()) {
return getDatabaseName() + "/documents";
} else {
return getDatabaseName() + "/documents/" + getPath();
}
} | java | String getName() {
String path = getPath();
if (path.isEmpty()) {
return getDatabaseName() + "/documents";
} else {
return getDatabaseName() + "/documents/" + getPath();
}
} | [
"String",
"getName",
"(",
")",
"{",
"String",
"path",
"=",
"getPath",
"(",
")",
";",
"if",
"(",
"path",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"getDatabaseName",
"(",
")",
"+",
"\"/documents\"",
";",
"}",
"else",
"{",
"return",
"getDatabaseName"... | String representation as expected by the Firestore API.
@return The formatted name of the resource. | [
"String",
"representation",
"as",
"expected",
"by",
"the",
"Firestore",
"API",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/ResourcePath.java#L128-L135 |
12,353 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java | DnsBatch.createZoneCallback | private RpcBatch.Callback<ManagedZone> createZoneCallback(
final DnsOptions serviceOptions,
final DnsBatchResult<Zone> result,
final boolean nullForNotFound,
final boolean idempotent) {
return new RpcBatch.Callback<ManagedZone>() {
@Override
public void onSuccess(ManagedZone resp... | java | private RpcBatch.Callback<ManagedZone> createZoneCallback(
final DnsOptions serviceOptions,
final DnsBatchResult<Zone> result,
final boolean nullForNotFound,
final boolean idempotent) {
return new RpcBatch.Callback<ManagedZone>() {
@Override
public void onSuccess(ManagedZone resp... | [
"private",
"RpcBatch",
".",
"Callback",
"<",
"ManagedZone",
">",
"createZoneCallback",
"(",
"final",
"DnsOptions",
"serviceOptions",
",",
"final",
"DnsBatchResult",
"<",
"Zone",
">",
"result",
",",
"final",
"boolean",
"nullForNotFound",
",",
"final",
"boolean",
"i... | A joint callback for both "get zone" and "create zone" operations. | [
"A",
"joint",
"callback",
"for",
"both",
"get",
"zone",
"and",
"create",
"zone",
"operations",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java#L258-L280 |
12,354 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java | DnsBatch.createChangeRequestCallback | private RpcBatch.Callback<Change> createChangeRequestCallback(
final String zoneName,
final DnsBatchResult<ChangeRequest> result,
final boolean nullForNotFound,
final boolean idempotent) {
return new RpcBatch.Callback<Change>() {
@Override
public void onSuccess(Change response) {... | java | private RpcBatch.Callback<Change> createChangeRequestCallback(
final String zoneName,
final DnsBatchResult<ChangeRequest> result,
final boolean nullForNotFound,
final boolean idempotent) {
return new RpcBatch.Callback<Change>() {
@Override
public void onSuccess(Change response) {... | [
"private",
"RpcBatch",
".",
"Callback",
"<",
"Change",
">",
"createChangeRequestCallback",
"(",
"final",
"String",
"zoneName",
",",
"final",
"DnsBatchResult",
"<",
"ChangeRequest",
">",
"result",
",",
"final",
"boolean",
"nullForNotFound",
",",
"final",
"boolean",
... | A joint callback for both "get change request" and "create change request" operations. | [
"A",
"joint",
"callback",
"for",
"both",
"get",
"change",
"request",
"and",
"create",
"change",
"request",
"operations",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-dns/src/main/java/com/google/cloud/dns/DnsBatch.java#L351-L381 |
12,355 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.createImplicitOrderBy | private List<FieldOrder> createImplicitOrderBy() {
List<FieldOrder> implicitOrders = new ArrayList<>(options.fieldOrders);
boolean hasDocumentId = false;
if (implicitOrders.isEmpty()) {
// If no explicit ordering is specified, use the first inequality to define an implicit order.
for (FieldFilt... | java | private List<FieldOrder> createImplicitOrderBy() {
List<FieldOrder> implicitOrders = new ArrayList<>(options.fieldOrders);
boolean hasDocumentId = false;
if (implicitOrders.isEmpty()) {
// If no explicit ordering is specified, use the first inequality to define an implicit order.
for (FieldFilt... | [
"private",
"List",
"<",
"FieldOrder",
">",
"createImplicitOrderBy",
"(",
")",
"{",
"List",
"<",
"FieldOrder",
">",
"implicitOrders",
"=",
"new",
"ArrayList",
"<>",
"(",
"options",
".",
"fieldOrders",
")",
";",
"boolean",
"hasDocumentId",
"=",
"false",
";",
"... | Computes the backend ordering semantics for DocumentSnapshot cursors. | [
"Computes",
"the",
"backend",
"ordering",
"semantics",
"for",
"DocumentSnapshot",
"cursors",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L286-L316 |
12,356 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.limit | @Nonnull
public Query limit(int limit) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.limit = limit;
return new Query(firestore, path, newOptions);
} | java | @Nonnull
public Query limit(int limit) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.limit = limit;
return new Query(firestore, path, newOptions);
} | [
"@",
"Nonnull",
"public",
"Query",
"limit",
"(",
"int",
"limit",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"limit",
"=",
"limit",
";",
"return",
"new",
"Query",
"(",
"firestore",
",",
... | Creates and returns a new Query that's additionally limited to only return up to the specified
number of documents.
@param limit The maximum number of items to return.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"s",
"additionally",
"limited",
"to",
"only",
"return",
"up",
"to",
"the",
"specified",
"number",
"of",
"documents",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L678-L683 |
12,357 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.offset | @Nonnull
public Query offset(int offset) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.offset = offset;
return new Query(firestore, path, newOptions);
} | java | @Nonnull
public Query offset(int offset) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.offset = offset;
return new Query(firestore, path, newOptions);
} | [
"@",
"Nonnull",
"public",
"Query",
"offset",
"(",
"int",
"offset",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"offset",
"=",
"offset",
";",
"return",
"new",
"Query",
"(",
"firestore",
",... | Creates and returns a new Query that skips the first n results.
@param offset The number of items to skip.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"skips",
"the",
"first",
"n",
"results",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L691-L696 |
12,358 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.startAt | @Nonnull
public Query startAt(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.startCursor = createCursor(newOptions.fieldOrders, fieldValues, true);
return new Query(firestore, path, newOptions);
} | java | @Nonnull
public Query startAt(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.startCursor = createCursor(newOptions.fieldOrders, fieldValues, true);
return new Query(firestore, path, newOptions);
} | [
"@",
"Nonnull",
"public",
"Query",
"startAt",
"(",
"Object",
"...",
"fieldValues",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"startCursor",
"=",
"createCursor",
"(",
"newOptions",
".",
"fie... | Creates and returns a new Query that starts at the provided fields relative to the order of the
query. The order of the field values must match the order of the order by clauses of the query.
@param fieldValues The field values to start this query at, in order of the query's order by.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"starts",
"at",
"the",
"provided",
"fields",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"order",
"of",
"the",
"field",
"values",
"must",
"match",
"the",
"order",
"of",
"th... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L721-L726 |
12,359 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.startAfter | public Query startAfter(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.startCursor = createCursor(newOptions.fieldOrders, fieldValues, false);
return new Query(firestore, path, newOptions);
} | java | public Query startAfter(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.startCursor = createCursor(newOptions.fieldOrders, fieldValues, false);
return new Query(firestore, path, newOptions);
} | [
"public",
"Query",
"startAfter",
"(",
"Object",
"...",
"fieldValues",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"startCursor",
"=",
"createCursor",
"(",
"newOptions",
".",
"fieldOrders",
",",... | Creates and returns a new Query that starts after the provided fields relative to the order of
the query. The order of the field values must match the order of the order by clauses of the
query.
@param fieldValues The field values to start this query after, in order of the query's order
by.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"starts",
"after",
"the",
"provided",
"fields",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"order",
"of",
"the",
"field",
"values",
"must",
"match",
"the",
"order",
"of",
... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L798-L802 |
12,360 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.endBefore | @Nonnull
public Query endBefore(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.endCursor = createCursor(newOptions.fieldOrders, fieldValues, true);
return new Query(firestore, path, newOptions);
} | java | @Nonnull
public Query endBefore(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.endCursor = createCursor(newOptions.fieldOrders, fieldValues, true);
return new Query(firestore, path, newOptions);
} | [
"@",
"Nonnull",
"public",
"Query",
"endBefore",
"(",
"Object",
"...",
"fieldValues",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"endCursor",
"=",
"createCursor",
"(",
"newOptions",
".",
"fie... | Creates and returns a new Query that ends before the provided fields relative to the order of
the query. The order of the field values must match the order of the order by clauses of the
query.
@param fieldValues The field values to end this query before, in order of the query's order by.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"ends",
"before",
"the",
"provided",
"fields",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"order",
"of",
"the",
"field",
"values",
"must",
"match",
"the",
"order",
"of",
"... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L828-L833 |
12,361 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.endAt | @Nonnull
public Query endAt(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.endCursor = createCursor(newOptions.fieldOrders, fieldValues, false);
return new Query(firestore, path, newOptions);
} | java | @Nonnull
public Query endAt(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.endCursor = createCursor(newOptions.fieldOrders, fieldValues, false);
return new Query(firestore, path, newOptions);
} | [
"@",
"Nonnull",
"public",
"Query",
"endAt",
"(",
"Object",
"...",
"fieldValues",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"endCursor",
"=",
"createCursor",
"(",
"newOptions",
".",
"fieldOr... | Creates and returns a new Query that ends at the provided fields relative to the order of the
query. The order of the field values must match the order of the order by clauses of the query.
@param fieldValues The field values to end this query at, in order of the query's order by.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"ends",
"at",
"the",
"provided",
"fields",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"order",
"of",
"the",
"field",
"values",
"must",
"match",
"the",
"order",
"of",
"the"... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L842-L847 |
12,362 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.buildQuery | StructuredQuery.Builder buildQuery() {
StructuredQuery.Builder structuredQuery = StructuredQuery.newBuilder();
structuredQuery.addFrom(
StructuredQuery.CollectionSelector.newBuilder().setCollectionId(path.getId()));
if (options.fieldFilters.size() == 1) {
Filter filter = options.fieldFilters.... | java | StructuredQuery.Builder buildQuery() {
StructuredQuery.Builder structuredQuery = StructuredQuery.newBuilder();
structuredQuery.addFrom(
StructuredQuery.CollectionSelector.newBuilder().setCollectionId(path.getId()));
if (options.fieldFilters.size() == 1) {
Filter filter = options.fieldFilters.... | [
"StructuredQuery",
".",
"Builder",
"buildQuery",
"(",
")",
"{",
"StructuredQuery",
".",
"Builder",
"structuredQuery",
"=",
"StructuredQuery",
".",
"newBuilder",
"(",
")",
";",
"structuredQuery",
".",
"addFrom",
"(",
"StructuredQuery",
".",
"CollectionSelector",
".",... | Build the final Firestore query. | [
"Build",
"the",
"final",
"Firestore",
"query",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L866-L919 |
12,363 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.stream | public void stream(@Nonnull final ApiStreamObserver<DocumentSnapshot> responseObserver) {
stream(
new QuerySnapshotObserver() {
@Override
public void onNext(QueryDocumentSnapshot documentSnapshot) {
responseObserver.onNext(documentSnapshot);
}
@Override
... | java | public void stream(@Nonnull final ApiStreamObserver<DocumentSnapshot> responseObserver) {
stream(
new QuerySnapshotObserver() {
@Override
public void onNext(QueryDocumentSnapshot documentSnapshot) {
responseObserver.onNext(documentSnapshot);
}
@Override
... | [
"public",
"void",
"stream",
"(",
"@",
"Nonnull",
"final",
"ApiStreamObserver",
"<",
"DocumentSnapshot",
">",
"responseObserver",
")",
"{",
"stream",
"(",
"new",
"QuerySnapshotObserver",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onNext",
"(",
"QueryDocum... | Executes the query and streams the results as a StreamObserver of DocumentSnapshots.
@param responseObserver The observer to be notified when results arrive. | [
"Executes",
"the",
"query",
"and",
"streams",
"the",
"results",
"as",
"a",
"StreamObserver",
"of",
"DocumentSnapshots",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L926-L945 |
12,364 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Operation.java | Operation.reload | public Operation<R, M> reload() throws SpannerException {
if (isDone) {
return this;
}
com.google.longrunning.Operation proto = rpc.getOperation(name);
return Operation.<R, M>create(rpc, proto, parser);
} | java | public Operation<R, M> reload() throws SpannerException {
if (isDone) {
return this;
}
com.google.longrunning.Operation proto = rpc.getOperation(name);
return Operation.<R, M>create(rpc, proto, parser);
} | [
"public",
"Operation",
"<",
"R",
",",
"M",
">",
"reload",
"(",
")",
"throws",
"SpannerException",
"{",
"if",
"(",
"isDone",
")",
"{",
"return",
"this",
";",
"}",
"com",
".",
"google",
".",
"longrunning",
".",
"Operation",
"proto",
"=",
"rpc",
".",
"g... | Fetches the current status of this operation. | [
"Fetches",
"the",
"current",
"status",
"of",
"this",
"operation",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Operation.java#L124-L130 |
12,365 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Operation.java | Operation.waitFor | public Operation<R, M> waitFor(RetryOption... waitOptions) throws SpannerException {
if (isDone()) {
return this;
}
RetrySettings waitSettings =
RetryOption.mergeToSettings(DEFAULT_OPERATION_WAIT_SETTINGS, waitOptions);
try {
com.google.longrunning.Operation proto =
RetryHe... | java | public Operation<R, M> waitFor(RetryOption... waitOptions) throws SpannerException {
if (isDone()) {
return this;
}
RetrySettings waitSettings =
RetryOption.mergeToSettings(DEFAULT_OPERATION_WAIT_SETTINGS, waitOptions);
try {
com.google.longrunning.Operation proto =
RetryHe... | [
"public",
"Operation",
"<",
"R",
",",
"M",
">",
"waitFor",
"(",
"RetryOption",
"...",
"waitOptions",
")",
"throws",
"SpannerException",
"{",
"if",
"(",
"isDone",
"(",
")",
")",
"{",
"return",
"this",
";",
"}",
"RetrySettings",
"waitSettings",
"=",
"RetryOp... | Blocks till the operation is complete or maximum time, if specified, has elapsed.
@return null if operation is not found otherwise the current operation. | [
"Blocks",
"till",
"the",
"operation",
"is",
"complete",
"or",
"maximum",
"time",
"if",
"specified",
"has",
"elapsed",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/Operation.java#L137-L187 |
12,366 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java | SecurityCenterClient.createFinding | public final Finding createFinding(SourceName parent, String findingId, Finding finding) {
CreateFindingRequest request =
CreateFindingRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setFindingId(findingId)
.setFinding(finding)
.bu... | java | public final Finding createFinding(SourceName parent, String findingId, Finding finding) {
CreateFindingRequest request =
CreateFindingRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setFindingId(findingId)
.setFinding(finding)
.bu... | [
"public",
"final",
"Finding",
"createFinding",
"(",
"SourceName",
"parent",
",",
"String",
"findingId",
",",
"Finding",
"finding",
")",
"{",
"CreateFindingRequest",
"request",
"=",
"CreateFindingRequest",
".",
"newBuilder",
"(",
")",
".",
"setParent",
"(",
"parent... | Creates a finding. The corresponding source must exist for finding creation to succeed.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SourceName parent = SourceName.of("[ORGANIZATION]", "[SOURCE]");
String findingId = "";
Finding finding = Finding.newBui... | [
"Creates",
"a",
"finding",
".",
"The",
"corresponding",
"source",
"must",
"exist",
"for",
"finding",
"creation",
"to",
"succeed",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java#L311-L320 |
12,367 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java | SecurityCenterClient.updateFinding | public final Finding updateFinding(Finding finding) {
UpdateFindingRequest request = UpdateFindingRequest.newBuilder().setFinding(finding).build();
return updateFinding(request);
} | java | public final Finding updateFinding(Finding finding) {
UpdateFindingRequest request = UpdateFindingRequest.newBuilder().setFinding(finding).build();
return updateFinding(request);
} | [
"public",
"final",
"Finding",
"updateFinding",
"(",
"Finding",
"finding",
")",
"{",
"UpdateFindingRequest",
"request",
"=",
"UpdateFindingRequest",
".",
"newBuilder",
"(",
")",
".",
"setFinding",
"(",
"finding",
")",
".",
"build",
"(",
")",
";",
"return",
"upd... | Creates or updates a finding. The corresponding source must exist for a finding creation to
succeed.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
Finding finding = Finding.newBuilder().build();
Finding response = securityCenterClient.updateFinding(findi... | [
"Creates",
"or",
"updates",
"a",
"finding",
".",
"The",
"corresponding",
"source",
"must",
"exist",
"for",
"a",
"finding",
"creation",
"to",
"succeed",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java#L1763-L1767 |
12,368 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java | SecurityCenterClient.updateOrganizationSettings | public final OrganizationSettings updateOrganizationSettings(
OrganizationSettings organizationSettings) {
UpdateOrganizationSettingsRequest request =
UpdateOrganizationSettingsRequest.newBuilder()
.setOrganizationSettings(organizationSettings)
.build();
return updateOrgan... | java | public final OrganizationSettings updateOrganizationSettings(
OrganizationSettings organizationSettings) {
UpdateOrganizationSettingsRequest request =
UpdateOrganizationSettingsRequest.newBuilder()
.setOrganizationSettings(organizationSettings)
.build();
return updateOrgan... | [
"public",
"final",
"OrganizationSettings",
"updateOrganizationSettings",
"(",
"OrganizationSettings",
"organizationSettings",
")",
"{",
"UpdateOrganizationSettingsRequest",
"request",
"=",
"UpdateOrganizationSettingsRequest",
".",
"newBuilder",
"(",
")",
".",
"setOrganizationSett... | Updates an organization's settings.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
OrganizationSettings organizationSettings = OrganizationSettings.newBuilder().build();
OrganizationSettings response = securityCenterClient.updateOrganizationSettings(organ... | [
"Updates",
"an",
"organization",
"s",
"settings",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java#L1832-L1840 |
12,369 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java | SecurityCenterClient.updateSource | public final Source updateSource(Source source) {
UpdateSourceRequest request = UpdateSourceRequest.newBuilder().setSource(source).build();
return updateSource(request);
} | java | public final Source updateSource(Source source) {
UpdateSourceRequest request = UpdateSourceRequest.newBuilder().setSource(source).build();
return updateSource(request);
} | [
"public",
"final",
"Source",
"updateSource",
"(",
"Source",
"source",
")",
"{",
"UpdateSourceRequest",
"request",
"=",
"UpdateSourceRequest",
".",
"newBuilder",
"(",
")",
".",
"setSource",
"(",
"source",
")",
".",
"build",
"(",
")",
";",
"return",
"updateSourc... | Updates a source.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
Source source = Source.newBuilder().build();
Source response = securityCenterClient.updateSource(source);
}
</code></pre>
@param source The source resource to update.
@throws com.google.api... | [
"Updates",
"a",
"source",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java#L1905-L1909 |
12,370 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java | SecurityCenterClient.updateSecurityMarks | public final SecurityMarks updateSecurityMarks(SecurityMarks securityMarks) {
UpdateSecurityMarksRequest request =
UpdateSecurityMarksRequest.newBuilder().setSecurityMarks(securityMarks).build();
return updateSecurityMarks(request);
} | java | public final SecurityMarks updateSecurityMarks(SecurityMarks securityMarks) {
UpdateSecurityMarksRequest request =
UpdateSecurityMarksRequest.newBuilder().setSecurityMarks(securityMarks).build();
return updateSecurityMarks(request);
} | [
"public",
"final",
"SecurityMarks",
"updateSecurityMarks",
"(",
"SecurityMarks",
"securityMarks",
")",
"{",
"UpdateSecurityMarksRequest",
"request",
"=",
"UpdateSecurityMarksRequest",
".",
"newBuilder",
"(",
")",
".",
"setSecurityMarks",
"(",
"securityMarks",
")",
".",
... | Updates security marks.
<p>Sample code:
<pre><code>
try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
SecurityMarks securityMarks = SecurityMarks.newBuilder().build();
SecurityMarks response = securityCenterClient.updateSecurityMarks(securityMarks);
}
</code></pre>
@param securityMark... | [
"Updates",
"security",
"marks",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-securitycenter/src/main/java/com/google/cloud/securitycenter/v1/SecurityCenterClient.java#L1972-L1977 |
12,371 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java | SpannerClient.listSessions | public final ListSessionsPagedResponse listSessions(String database) {
ListSessionsRequest request = ListSessionsRequest.newBuilder().setDatabase(database).build();
return listSessions(request);
} | java | public final ListSessionsPagedResponse listSessions(String database) {
ListSessionsRequest request = ListSessionsRequest.newBuilder().setDatabase(database).build();
return listSessions(request);
} | [
"public",
"final",
"ListSessionsPagedResponse",
"listSessions",
"(",
"String",
"database",
")",
"{",
"ListSessionsRequest",
"request",
"=",
"ListSessionsRequest",
".",
"newBuilder",
"(",
")",
".",
"setDatabase",
"(",
"database",
")",
".",
"build",
"(",
")",
";",
... | Lists all sessions in a given database.
<p>Sample code:
<pre><code>
try (SpannerClient spannerClient = SpannerClient.create()) {
String formattedDatabase = DatabaseName.format("[PROJECT]", "[INSTANCE]", "[DATABASE]");
for (Session element : spannerClient.listSessions(formattedDatabase).iterateAll()) {
// doThingsWith... | [
"Lists",
"all",
"sessions",
"in",
"a",
"given",
"database",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java#L443-L446 |
12,372 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Key.java | Key.toUrlSafe | public String toUrlSafe() {
try {
return URLEncoder.encode(TextFormat.printToString(toPb()), UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("Unexpected encoding exception", e);
}
} | java | public String toUrlSafe() {
try {
return URLEncoder.encode(TextFormat.printToString(toPb()), UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("Unexpected encoding exception", e);
}
} | [
"public",
"String",
"toUrlSafe",
"(",
")",
"{",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"TextFormat",
".",
"printToString",
"(",
"toPb",
"(",
")",
")",
",",
"UTF_8",
".",
"name",
"(",
")",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodi... | Returns the key in an encoded form that can be used as part of a URL. | [
"Returns",
"the",
"key",
"in",
"an",
"encoded",
"form",
"that",
"can",
"be",
"used",
"as",
"part",
"of",
"a",
"URL",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datastore/src/main/java/com/google/cloud/datastore/Key.java#L129-L135 |
12,373 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java | InstanceAdminExample.createProdInstance | public void createProdInstance() {
// Checks if instance exists, creates instance if does not exists.
if (!adminClient.exists(instanceId)) {
System.out.println("Instance does not exist, creating a PRODUCTION instance");
// [START bigtable_create_prod_instance]
// Creates a Production Instance ... | java | public void createProdInstance() {
// Checks if instance exists, creates instance if does not exists.
if (!adminClient.exists(instanceId)) {
System.out.println("Instance does not exist, creating a PRODUCTION instance");
// [START bigtable_create_prod_instance]
// Creates a Production Instance ... | [
"public",
"void",
"createProdInstance",
"(",
")",
"{",
"// Checks if instance exists, creates instance if does not exists.",
"if",
"(",
"!",
"adminClient",
".",
"exists",
"(",
"instanceId",
")",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Instance does not... | Demonstrates how to create a Production instance within a provided project. | [
"Demonstrates",
"how",
"to",
"create",
"a",
"Production",
"instance",
"within",
"a",
"provided",
"project",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java#L95-L117 |
12,374 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java | InstanceAdminExample.listInstances | public void listInstances() {
System.out.println("\nListing Instances");
// [START bigtable_list_instances]
try {
List<Instance> instances = adminClient.listInstances();
for (Instance instance : instances) {
System.out.println(instance.getId());
}
} catch (PartialListInstancesE... | java | public void listInstances() {
System.out.println("\nListing Instances");
// [START bigtable_list_instances]
try {
List<Instance> instances = adminClient.listInstances();
for (Instance instance : instances) {
System.out.println(instance.getId());
}
} catch (PartialListInstancesE... | [
"public",
"void",
"listInstances",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"\\nListing Instances\"",
")",
";",
"// [START bigtable_list_instances]",
"try",
"{",
"List",
"<",
"Instance",
">",
"instances",
"=",
"adminClient",
".",
"listInstances"... | Demonstrates how to list all instances within a project. | [
"Demonstrates",
"how",
"to",
"list",
"all",
"instances",
"within",
"a",
"project",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java#L120-L134 |
12,375 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java | InstanceAdminExample.getInstance | public Instance getInstance() {
System.out.println("\nGet Instance");
// [START bigtable_get_instance]
Instance instance = null;
try {
instance = adminClient.getInstance(instanceId);
System.out.println("Instance ID: " + instance.getId());
System.out.println("Display Name: " + instance.... | java | public Instance getInstance() {
System.out.println("\nGet Instance");
// [START bigtable_get_instance]
Instance instance = null;
try {
instance = adminClient.getInstance(instanceId);
System.out.println("Instance ID: " + instance.getId());
System.out.println("Display Name: " + instance.... | [
"public",
"Instance",
"getInstance",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"\\nGet Instance\"",
")",
";",
"// [START bigtable_get_instance]",
"Instance",
"instance",
"=",
"null",
";",
"try",
"{",
"instance",
"=",
"adminClient",
".",
"getIns... | Demonstrates how to get an instance. | [
"Demonstrates",
"how",
"to",
"get",
"an",
"instance",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java#L137-L157 |
12,376 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java | InstanceAdminExample.listClusters | public void listClusters() {
System.out.println("\nListing Clusters");
// [START bigtable_get_clusters]
try {
List<Cluster> clusters = adminClient.listClusters(instanceId);
for (Cluster cluster : clusters) {
System.out.println(cluster.getId());
}
} catch (NotFoundException e) {... | java | public void listClusters() {
System.out.println("\nListing Clusters");
// [START bigtable_get_clusters]
try {
List<Cluster> clusters = adminClient.listClusters(instanceId);
for (Cluster cluster : clusters) {
System.out.println(cluster.getId());
}
} catch (NotFoundException e) {... | [
"public",
"void",
"listClusters",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"\\nListing Clusters\"",
")",
";",
"// [START bigtable_get_clusters]",
"try",
"{",
"List",
"<",
"Cluster",
">",
"clusters",
"=",
"adminClient",
".",
"listClusters",
"("... | Demonstrates how to list clusters within an instance. | [
"Demonstrates",
"how",
"to",
"list",
"clusters",
"within",
"an",
"instance",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java#L160-L172 |
12,377 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java | InstanceAdminExample.deleteInstance | public void deleteInstance() {
System.out.println("\nDeleting Instance");
// [START bigtable_delete_instance]
try {
adminClient.deleteInstance(instanceId);
System.out.println("Instance deleted: " + instanceId);
} catch (NotFoundException e) {
System.err.println("Failed to delete non-ex... | java | public void deleteInstance() {
System.out.println("\nDeleting Instance");
// [START bigtable_delete_instance]
try {
adminClient.deleteInstance(instanceId);
System.out.println("Instance deleted: " + instanceId);
} catch (NotFoundException e) {
System.err.println("Failed to delete non-ex... | [
"public",
"void",
"deleteInstance",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"\\nDeleting Instance\"",
")",
";",
"// [START bigtable_delete_instance]",
"try",
"{",
"adminClient",
".",
"deleteInstance",
"(",
"instanceId",
")",
";",
"System",
".",... | Demonstrates how to delete an instance. | [
"Demonstrates",
"how",
"to",
"delete",
"an",
"instance",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java#L175-L185 |
12,378 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java | InstanceAdminExample.addCluster | public void addCluster() {
System.out.printf("%nAdding cluster: %s to instance: %s%n", CLUSTER, instanceId);
// [START bigtable_create_cluster]
try {
adminClient.createCluster(
CreateClusterRequest.of(instanceId, CLUSTER)
.setZone("us-central1-c")
.setServeNodes(3... | java | public void addCluster() {
System.out.printf("%nAdding cluster: %s to instance: %s%n", CLUSTER, instanceId);
// [START bigtable_create_cluster]
try {
adminClient.createCluster(
CreateClusterRequest.of(instanceId, CLUSTER)
.setZone("us-central1-c")
.setServeNodes(3... | [
"public",
"void",
"addCluster",
"(",
")",
"{",
"System",
".",
"out",
".",
"printf",
"(",
"\"%nAdding cluster: %s to instance: %s%n\"",
",",
"CLUSTER",
",",
"instanceId",
")",
";",
"// [START bigtable_create_cluster]",
"try",
"{",
"adminClient",
".",
"createCluster",
... | Demonstrates how to add a cluster to an instance. | [
"Demonstrates",
"how",
"to",
"add",
"a",
"cluster",
"to",
"an",
"instance",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java#L188-L202 |
12,379 | googleapis/google-cloud-java | google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java | InstanceAdminExample.deleteCluster | public void deleteCluster() {
System.out.printf("%nDeleting cluster: %s from instance: %s%n", CLUSTER, instanceId);
// [START bigtable_delete_cluster]
try {
adminClient.deleteCluster(instanceId, CLUSTER);
System.out.printf("Cluster: %s deleted successfully%n", CLUSTER);
} catch (NotFoundExce... | java | public void deleteCluster() {
System.out.printf("%nDeleting cluster: %s from instance: %s%n", CLUSTER, instanceId);
// [START bigtable_delete_cluster]
try {
adminClient.deleteCluster(instanceId, CLUSTER);
System.out.printf("Cluster: %s deleted successfully%n", CLUSTER);
} catch (NotFoundExce... | [
"public",
"void",
"deleteCluster",
"(",
")",
"{",
"System",
".",
"out",
".",
"printf",
"(",
"\"%nDeleting cluster: %s from instance: %s%n\"",
",",
"CLUSTER",
",",
"instanceId",
")",
";",
"// [START bigtable_delete_cluster]",
"try",
"{",
"adminClient",
".",
"deleteClus... | Demonstrates how to delete a cluster from an instance. | [
"Demonstrates",
"how",
"to",
"delete",
"a",
"cluster",
"from",
"an",
"instance",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/bigtable/InstanceAdminExample.java#L205-L215 |
12,380 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java | Disk.createSnapshot | public Operation createSnapshot(String snapshot, OperationOption... options) {
return compute.create(SnapshotInfo.of(SnapshotId.of(snapshot), getDiskId()), options);
} | java | public Operation createSnapshot(String snapshot, OperationOption... options) {
return compute.create(SnapshotInfo.of(SnapshotId.of(snapshot), getDiskId()), options);
} | [
"public",
"Operation",
"createSnapshot",
"(",
"String",
"snapshot",
",",
"OperationOption",
"...",
"options",
")",
"{",
"return",
"compute",
".",
"create",
"(",
"SnapshotInfo",
".",
"of",
"(",
"SnapshotId",
".",
"of",
"(",
"snapshot",
")",
",",
"getDiskId",
... | Creates a snapshot for this disk given the snapshot's name.
@return a zone operation for snapshot creation
@throws ComputeException upon failure | [
"Creates",
"a",
"snapshot",
"for",
"this",
"disk",
"given",
"the",
"snapshot",
"s",
"name",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java#L169-L171 |
12,381 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java | Disk.createSnapshot | public Operation createSnapshot(String snapshot, String description, OperationOption... options) {
SnapshotInfo snapshotInfo =
SnapshotInfo.newBuilder(SnapshotId.of(snapshot), getDiskId())
.setDescription(description)
.build();
return compute.create(snapshotInfo, options);
} | java | public Operation createSnapshot(String snapshot, String description, OperationOption... options) {
SnapshotInfo snapshotInfo =
SnapshotInfo.newBuilder(SnapshotId.of(snapshot), getDiskId())
.setDescription(description)
.build();
return compute.create(snapshotInfo, options);
} | [
"public",
"Operation",
"createSnapshot",
"(",
"String",
"snapshot",
",",
"String",
"description",
",",
"OperationOption",
"...",
"options",
")",
"{",
"SnapshotInfo",
"snapshotInfo",
"=",
"SnapshotInfo",
".",
"newBuilder",
"(",
"SnapshotId",
".",
"of",
"(",
"snapsh... | Creates a snapshot for this disk given the snapshot's name and description.
@return a zone operation for snapshot creation
@throws ComputeException upon failure | [
"Creates",
"a",
"snapshot",
"for",
"this",
"disk",
"given",
"the",
"snapshot",
"s",
"name",
"and",
"description",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java#L179-L185 |
12,382 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java | Disk.createImage | public Operation createImage(String image, OperationOption... options) {
ImageInfo imageInfo = ImageInfo.of(ImageId.of(image), DiskImageConfiguration.of(getDiskId()));
return compute.create(imageInfo, options);
} | java | public Operation createImage(String image, OperationOption... options) {
ImageInfo imageInfo = ImageInfo.of(ImageId.of(image), DiskImageConfiguration.of(getDiskId()));
return compute.create(imageInfo, options);
} | [
"public",
"Operation",
"createImage",
"(",
"String",
"image",
",",
"OperationOption",
"...",
"options",
")",
"{",
"ImageInfo",
"imageInfo",
"=",
"ImageInfo",
".",
"of",
"(",
"ImageId",
".",
"of",
"(",
"image",
")",
",",
"DiskImageConfiguration",
".",
"of",
"... | Creates an image for this disk given the image's name.
@return a global operation if the image creation was successfully requested
@throws ComputeException upon failure | [
"Creates",
"an",
"image",
"for",
"this",
"disk",
"given",
"the",
"image",
"s",
"name",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java#L193-L196 |
12,383 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java | Disk.createImage | public Operation createImage(String image, String description, OperationOption... options) {
ImageInfo imageInfo =
ImageInfo.newBuilder(ImageId.of(image), DiskImageConfiguration.of(getDiskId()))
.setDescription(description)
.build();
return compute.create(imageInfo, options);
} | java | public Operation createImage(String image, String description, OperationOption... options) {
ImageInfo imageInfo =
ImageInfo.newBuilder(ImageId.of(image), DiskImageConfiguration.of(getDiskId()))
.setDescription(description)
.build();
return compute.create(imageInfo, options);
} | [
"public",
"Operation",
"createImage",
"(",
"String",
"image",
",",
"String",
"description",
",",
"OperationOption",
"...",
"options",
")",
"{",
"ImageInfo",
"imageInfo",
"=",
"ImageInfo",
".",
"newBuilder",
"(",
"ImageId",
".",
"of",
"(",
"image",
")",
",",
... | Creates an image for this disk given the image's name and description.
@return a global operation if the image creation was successfully requested
@throws ComputeException upon failure | [
"Creates",
"an",
"image",
"for",
"this",
"disk",
"given",
"the",
"image",
"s",
"name",
"and",
"description",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java#L204-L210 |
12,384 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java | Disk.resize | public Operation resize(long sizeGb, OperationOption... options) {
return compute.resize(getDiskId(), sizeGb, options);
} | java | public Operation resize(long sizeGb, OperationOption... options) {
return compute.resize(getDiskId(), sizeGb, options);
} | [
"public",
"Operation",
"resize",
"(",
"long",
"sizeGb",
",",
"OperationOption",
"...",
"options",
")",
"{",
"return",
"compute",
".",
"resize",
"(",
"getDiskId",
"(",
")",
",",
"sizeGb",
",",
"options",
")",
";",
"}"
] | Resizes this disk to the requested size. The new size must be larger than the previous one.
@return a zone operation if the resize request was issued correctly, {@code null} if this disk
was not found
@throws ComputeException upon failure or if the new disk size is smaller than the previous one | [
"Resizes",
"this",
"disk",
"to",
"the",
"requested",
"size",
".",
"The",
"new",
"size",
"must",
"be",
"larger",
"than",
"the",
"previous",
"one",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/deprecated/Disk.java#L219-L221 |
12,385 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.newBuilder | public static Builder newBuilder(TableId destinationTable, List<String> sourceUris) {
return new Builder().setDestinationTable(destinationTable).setSourceUris(sourceUris);
} | java | public static Builder newBuilder(TableId destinationTable, List<String> sourceUris) {
return new Builder().setDestinationTable(destinationTable).setSourceUris(sourceUris);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"destinationTable",
",",
"List",
"<",
"String",
">",
"sourceUris",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"setDestinationTable",
"(",
"destinationTable",
")",
".",
"setSourceUris",
"(",
... | Creates a builder for a BigQuery Load Job configuration given the destination table and source
URIs. | [
"Creates",
"a",
"builder",
"for",
"a",
"BigQuery",
"Load",
"Job",
"configuration",
"given",
"the",
"destination",
"table",
"and",
"source",
"URIs",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L493-L495 |
12,386 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.newBuilder | public static Builder newBuilder(
TableId destinationTable, List<String> sourceUris, FormatOptions format) {
return newBuilder(destinationTable, sourceUris).setFormatOptions(format);
} | java | public static Builder newBuilder(
TableId destinationTable, List<String> sourceUris, FormatOptions format) {
return newBuilder(destinationTable, sourceUris).setFormatOptions(format);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"destinationTable",
",",
"List",
"<",
"String",
">",
"sourceUris",
",",
"FormatOptions",
"format",
")",
"{",
"return",
"newBuilder",
"(",
"destinationTable",
",",
"sourceUris",
")",
".",
"setFormatOption... | Creates a builder for a BigQuery Load Job configuration given the destination table, format and
source URIs. | [
"Creates",
"a",
"builder",
"for",
"a",
"BigQuery",
"Load",
"Job",
"configuration",
"given",
"the",
"destination",
"table",
"format",
"and",
"source",
"URIs",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L517-L520 |
12,387 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.newBuilder | public static Builder newBuilder(
TableId destinationTable, String sourceUri, FormatOptions format) {
return newBuilder(destinationTable, ImmutableList.of(sourceUri), format);
} | java | public static Builder newBuilder(
TableId destinationTable, String sourceUri, FormatOptions format) {
return newBuilder(destinationTable, ImmutableList.of(sourceUri), format);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"destinationTable",
",",
"String",
"sourceUri",
",",
"FormatOptions",
"format",
")",
"{",
"return",
"newBuilder",
"(",
"destinationTable",
",",
"ImmutableList",
".",
"of",
"(",
"sourceUri",
")",
",",
"... | Creates a builder for a BigQuery Load Job configuration given the destination table, format and
source URI. | [
"Creates",
"a",
"builder",
"for",
"a",
"BigQuery",
"Load",
"Job",
"configuration",
"given",
"the",
"destination",
"table",
"format",
"and",
"source",
"URI",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L526-L529 |
12,388 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.of | public static LoadJobConfiguration of(TableId destinationTable, List<String> sourceUris) {
return newBuilder(destinationTable, sourceUris).build();
} | java | public static LoadJobConfiguration of(TableId destinationTable, List<String> sourceUris) {
return newBuilder(destinationTable, sourceUris).build();
} | [
"public",
"static",
"LoadJobConfiguration",
"of",
"(",
"TableId",
"destinationTable",
",",
"List",
"<",
"String",
">",
"sourceUris",
")",
"{",
"return",
"newBuilder",
"(",
"destinationTable",
",",
"sourceUris",
")",
".",
"build",
"(",
")",
";",
"}"
] | Returns a BigQuery Load Job Configuration for the given destination table and source URIs. | [
"Returns",
"a",
"BigQuery",
"Load",
"Job",
"Configuration",
"for",
"the",
"given",
"destination",
"table",
"and",
"source",
"URIs",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L532-L534 |
12,389 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.of | public static LoadJobConfiguration of(TableId destinationTable, String sourceUri) {
return of(destinationTable, ImmutableList.of(sourceUri));
} | java | public static LoadJobConfiguration of(TableId destinationTable, String sourceUri) {
return of(destinationTable, ImmutableList.of(sourceUri));
} | [
"public",
"static",
"LoadJobConfiguration",
"of",
"(",
"TableId",
"destinationTable",
",",
"String",
"sourceUri",
")",
"{",
"return",
"of",
"(",
"destinationTable",
",",
"ImmutableList",
".",
"of",
"(",
"sourceUri",
")",
")",
";",
"}"
] | Returns a BigQuery Load Job Configuration for the given destination table and source URI. | [
"Returns",
"a",
"BigQuery",
"Load",
"Job",
"Configuration",
"for",
"the",
"given",
"destination",
"table",
"and",
"source",
"URI",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L537-L539 |
12,390 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.of | public static LoadJobConfiguration of(
TableId destinationTable, String sourceUri, FormatOptions format) {
return of(destinationTable, ImmutableList.of(sourceUri), format);
} | java | public static LoadJobConfiguration of(
TableId destinationTable, String sourceUri, FormatOptions format) {
return of(destinationTable, ImmutableList.of(sourceUri), format);
} | [
"public",
"static",
"LoadJobConfiguration",
"of",
"(",
"TableId",
"destinationTable",
",",
"String",
"sourceUri",
",",
"FormatOptions",
"format",
")",
"{",
"return",
"of",
"(",
"destinationTable",
",",
"ImmutableList",
".",
"of",
"(",
"sourceUri",
")",
",",
"for... | Returns a BigQuery Load Job Configuration for the given destination table, format and source
URI. | [
"Returns",
"a",
"BigQuery",
"Load",
"Job",
"Configuration",
"for",
"the",
"given",
"destination",
"table",
"format",
"and",
"source",
"URI",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L554-L557 |
12,391 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java | Dataset.create | public Table create(String tableId, TableDefinition definition, TableOption... options) {
TableInfo tableInfo =
TableInfo.of(TableId.of(getDatasetId().getDataset(), tableId), definition);
return bigquery.create(tableInfo, options);
} | java | public Table create(String tableId, TableDefinition definition, TableOption... options) {
TableInfo tableInfo =
TableInfo.of(TableId.of(getDatasetId().getDataset(), tableId), definition);
return bigquery.create(tableInfo, options);
} | [
"public",
"Table",
"create",
"(",
"String",
"tableId",
",",
"TableDefinition",
"definition",
",",
"TableOption",
"...",
"options",
")",
"{",
"TableInfo",
"tableInfo",
"=",
"TableInfo",
".",
"of",
"(",
"TableId",
".",
"of",
"(",
"getDatasetId",
"(",
")",
".",... | Creates a new table in this dataset.
<p>Example of creating a table in the dataset with schema and time partitioning.
<pre>{@code
String tableName = “my_table”;
String fieldName = “my_field”;
Schema schema = Schema.of(Field.of(fieldName, LegacySQLTypeName.STRING));
StandardTableDefinition definition = StandardTableDe... | [
"Creates",
"a",
"new",
"table",
"in",
"this",
"dataset",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Dataset.java#L290-L294 |
12,392 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Transaction.java | Transaction.begin | ApiFuture<Void> begin() {
BeginTransactionRequest.Builder beginTransaction = BeginTransactionRequest.newBuilder();
beginTransaction.setDatabase(firestore.getDatabaseName());
if (previousTransactionId != null) {
beginTransaction
.getOptionsBuilder()
.getReadWriteBuilder()
... | java | ApiFuture<Void> begin() {
BeginTransactionRequest.Builder beginTransaction = BeginTransactionRequest.newBuilder();
beginTransaction.setDatabase(firestore.getDatabaseName());
if (previousTransactionId != null) {
beginTransaction
.getOptionsBuilder()
.getReadWriteBuilder()
... | [
"ApiFuture",
"<",
"Void",
">",
"begin",
"(",
")",
"{",
"BeginTransactionRequest",
".",
"Builder",
"beginTransaction",
"=",
"BeginTransactionRequest",
".",
"newBuilder",
"(",
")",
";",
"beginTransaction",
".",
"setDatabase",
"(",
"firestore",
".",
"getDatabaseName",
... | Starts a transaction and obtains the transaction id from the server. | [
"Starts",
"a",
"transaction",
"and",
"obtains",
"the",
"transaction",
"id",
"from",
"the",
"server",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Transaction.java#L72-L97 |
12,393 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Transaction.java | Transaction.rollback | ApiFuture<Void> rollback() {
pending = false;
RollbackRequest.Builder reqBuilder = RollbackRequest.newBuilder();
reqBuilder.setTransaction(transactionId);
reqBuilder.setDatabase(firestore.getDatabaseName());
ApiFuture<Empty> rollbackFuture =
firestore.sendRequest(reqBuilder.build(), firest... | java | ApiFuture<Void> rollback() {
pending = false;
RollbackRequest.Builder reqBuilder = RollbackRequest.newBuilder();
reqBuilder.setTransaction(transactionId);
reqBuilder.setDatabase(firestore.getDatabaseName());
ApiFuture<Empty> rollbackFuture =
firestore.sendRequest(reqBuilder.build(), firest... | [
"ApiFuture",
"<",
"Void",
">",
"rollback",
"(",
")",
"{",
"pending",
"=",
"false",
";",
"RollbackRequest",
".",
"Builder",
"reqBuilder",
"=",
"RollbackRequest",
".",
"newBuilder",
"(",
")",
";",
"reqBuilder",
".",
"setTransaction",
"(",
"transactionId",
")",
... | Rolls a transaction back and releases all read locks. | [
"Rolls",
"a",
"transaction",
"back",
"and",
"releases",
"all",
"read",
"locks",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Transaction.java#L106-L124 |
12,394 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquerydatatransfer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceClient.java | DataTransferServiceClient.updateTransferConfig | public final TransferConfig updateTransferConfig(
TransferConfig transferConfig, FieldMask updateMask) {
UpdateTransferConfigRequest request =
UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
.setUpdateMask(updateMask)
.build();
retur... | java | public final TransferConfig updateTransferConfig(
TransferConfig transferConfig, FieldMask updateMask) {
UpdateTransferConfigRequest request =
UpdateTransferConfigRequest.newBuilder()
.setTransferConfig(transferConfig)
.setUpdateMask(updateMask)
.build();
retur... | [
"public",
"final",
"TransferConfig",
"updateTransferConfig",
"(",
"TransferConfig",
"transferConfig",
",",
"FieldMask",
"updateMask",
")",
"{",
"UpdateTransferConfigRequest",
"request",
"=",
"UpdateTransferConfigRequest",
".",
"newBuilder",
"(",
")",
".",
"setTransferConfig... | Updates a data transfer configuration. All fields must be set, even if they are not updated.
<p>Sample code:
<pre><code>
try (DataTransferServiceClient dataTransferServiceClient = DataTransferServiceClient.create()) {
TransferConfig transferConfig = TransferConfig.newBuilder().build();
FieldMask updateMask = FieldMas... | [
"Updates",
"a",
"data",
"transfer",
"configuration",
".",
"All",
"fields",
"must",
"be",
"set",
"even",
"if",
"they",
"are",
"not",
"updated",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquerydatatransfer/src/main/java/com/google/cloud/bigquery/datatransfer/v1/DataTransferServiceClient.java#L516-L525 |
12,395 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java | StateMachine.handleLastScannedRow | void handleLastScannedRow(ByteString key) {
try {
currentState = currentState.handleLastScannedRow(key);
} catch (RuntimeException e) {
currentState = null;
throw e;
}
} | java | void handleLastScannedRow(ByteString key) {
try {
currentState = currentState.handleLastScannedRow(key);
} catch (RuntimeException e) {
currentState = null;
throw e;
}
} | [
"void",
"handleLastScannedRow",
"(",
"ByteString",
"key",
")",
"{",
"try",
"{",
"currentState",
"=",
"currentState",
".",
"handleLastScannedRow",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"e",
")",
"{",
"currentState",
"=",
"null",
";",
"t... | Handle last scanned row events from the server.
<p>The server might return the row key of the last row it has scanned. The client can use this
to construct a more efficient retry request if needed: any row keys or portions of ranges less
than this row key can be dropped from the request. The retry logic is implemented... | [
"Handle",
"last",
"scanned",
"row",
"events",
"from",
"the",
"server",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java#L121-L128 |
12,396 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java | StateMachine.handleChunk | void handleChunk(CellChunk chunk) {
try {
currentState = currentState.handleChunk(chunk);
} catch (RuntimeException e) {
currentState = null;
throw e;
}
} | java | void handleChunk(CellChunk chunk) {
try {
currentState = currentState.handleChunk(chunk);
} catch (RuntimeException e) {
currentState = null;
throw e;
}
} | [
"void",
"handleChunk",
"(",
"CellChunk",
"chunk",
")",
"{",
"try",
"{",
"currentState",
"=",
"currentState",
".",
"handleChunk",
"(",
"chunk",
")",
";",
"}",
"catch",
"(",
"RuntimeException",
"e",
")",
"{",
"currentState",
"=",
"null",
";",
"throw",
"e",
... | Feeds a new chunk into the sate machine. If the chunk is invalid, the state machine will throw
an exception and should not be used for further input.
<dl>
<dt>Valid states:
<dd>{@link StateMachine#AWAITING_NEW_ROW}
<dd>{@link StateMachine#AWAITING_NEW_CELL}
<dd>{@link StateMachine#AWAITING_CELL_VALUE}
<dt>Resulting st... | [
"Feeds",
"a",
"new",
"chunk",
"into",
"the",
"sate",
"machine",
".",
"If",
"the",
"chunk",
"is",
"invalid",
"the",
"state",
"machine",
"will",
"throw",
"an",
"exception",
"and",
"should",
"not",
"be",
"used",
"for",
"further",
"input",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java#L149-L156 |
12,397 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java | StateMachine.consumeRow | RowT consumeRow() {
Preconditions.checkState(currentState == AWAITING_ROW_CONSUME, "No row to consume");
RowT row = completeRow;
reset();
return row;
} | java | RowT consumeRow() {
Preconditions.checkState(currentState == AWAITING_ROW_CONSUME, "No row to consume");
RowT row = completeRow;
reset();
return row;
} | [
"RowT",
"consumeRow",
"(",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"currentState",
"==",
"AWAITING_ROW_CONSUME",
",",
"\"No row to consume\"",
")",
";",
"RowT",
"row",
"=",
"completeRow",
";",
"reset",
"(",
")",
";",
"return",
"row",
";",
"}"
] | Returns the last completed row and transitions to awaiting a new row.
@return The last completed row.
@throws IllegalStateException If the last chunk did not complete a row. | [
"Returns",
"the",
"last",
"completed",
"row",
"and",
"transitions",
"to",
"awaiting",
"a",
"new",
"row",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/readrows/StateMachine.java#L164-L169 |
12,398 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java | DataLabelingServiceClient.formatAnnotatedDatasetName | @Deprecated
public static final String formatAnnotatedDatasetName(
String project, String dataset, String annotatedDataset) {
return ANNOTATED_DATASET_PATH_TEMPLATE.instantiate(
"project", project,
"dataset", dataset,
"annotated_dataset", annotatedDataset);
} | java | @Deprecated
public static final String formatAnnotatedDatasetName(
String project, String dataset, String annotatedDataset) {
return ANNOTATED_DATASET_PATH_TEMPLATE.instantiate(
"project", project,
"dataset", dataset,
"annotated_dataset", annotatedDataset);
} | [
"@",
"Deprecated",
"public",
"static",
"final",
"String",
"formatAnnotatedDatasetName",
"(",
"String",
"project",
",",
"String",
"dataset",
",",
"String",
"annotatedDataset",
")",
"{",
"return",
"ANNOTATED_DATASET_PATH_TEMPLATE",
".",
"instantiate",
"(",
"\"project\"",
... | Formats a string containing the fully-qualified path to represent a annotated_dataset resource.
@deprecated Use the {@link AnnotatedDatasetName} class instead. | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"annotated_dataset",
"resource",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java#L147-L154 |
12,399 | googleapis/google-cloud-java | google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java | DataLabelingServiceClient.formatAnnotationSpecSetName | @Deprecated
public static final String formatAnnotationSpecSetName(String project, String annotationSpecSet) {
return ANNOTATION_SPEC_SET_PATH_TEMPLATE.instantiate(
"project", project,
"annotation_spec_set", annotationSpecSet);
} | java | @Deprecated
public static final String formatAnnotationSpecSetName(String project, String annotationSpecSet) {
return ANNOTATION_SPEC_SET_PATH_TEMPLATE.instantiate(
"project", project,
"annotation_spec_set", annotationSpecSet);
} | [
"@",
"Deprecated",
"public",
"static",
"final",
"String",
"formatAnnotationSpecSetName",
"(",
"String",
"project",
",",
"String",
"annotationSpecSet",
")",
"{",
"return",
"ANNOTATION_SPEC_SET_PATH_TEMPLATE",
".",
"instantiate",
"(",
"\"project\"",
",",
"project",
",",
... | Formats a string containing the fully-qualified path to represent a annotation_spec_set
resource.
@deprecated Use the {@link AnnotationSpecSetName} class instead. | [
"Formats",
"a",
"string",
"containing",
"the",
"fully",
"-",
"qualified",
"path",
"to",
"represent",
"a",
"annotation_spec_set",
"resource",
"."
] | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java#L162-L167 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.