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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
131,000 | h2oai/h2o-3 | h2o-algos/src/main/java/hex/deepwater/DeepWaterModelInfo.java | DeepWaterModelInfo.createSummaryTable | TwoDimTable createSummaryTable() {
TwoDimTable table = new TwoDimTable(
"Status of Deep Learning Model",
(get_params()._network == null ? ("MLP: " + Arrays.toString(get_params()._hidden)) : get_params()._network.toString()) + ", " + PrettyPrint.bytes(size()) + ", "
+ (!get_params()._autoenco... | java | TwoDimTable createSummaryTable() {
TwoDimTable table = new TwoDimTable(
"Status of Deep Learning Model",
(get_params()._network == null ? ("MLP: " + Arrays.toString(get_params()._hidden)) : get_params()._network.toString()) + ", " + PrettyPrint.bytes(size()) + ", "
+ (!get_params()._autoenco... | [
"TwoDimTable",
"createSummaryTable",
"(",
")",
"{",
"TwoDimTable",
"table",
"=",
"new",
"TwoDimTable",
"(",
"\"Status of Deep Learning Model\"",
",",
"(",
"get_params",
"(",
")",
".",
"_network",
"==",
"null",
"?",
"(",
"\"MLP: \"",
"+",
"Arrays",
".",
"toString... | Create a summary table
@return TwoDimTable with the summary of the model | [
"Create",
"a",
"summary",
"table"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/deepwater/DeepWaterModelInfo.java#L399-L419 |
131,001 | h2oai/h2o-3 | h2o-core/src/main/java/water/nbhm/NonBlockingIdentityHashMap.java | NonBlockingIdentityHashMap.print | private final void print( Object[] kvs ) {
for( int i=0; i<len(kvs); i++ ) {
Object K = key(kvs,i);
if( K != null ) {
String KS = (K == TOMBSTONE) ? "XXX" : K.toString();
Object V = val(kvs,i);
Object U = Prime.unbox(V);
String p = (V==U) ? "" : "prime_";
String U... | java | private final void print( Object[] kvs ) {
for( int i=0; i<len(kvs); i++ ) {
Object K = key(kvs,i);
if( K != null ) {
String KS = (K == TOMBSTONE) ? "XXX" : K.toString();
Object V = val(kvs,i);
Object U = Prime.unbox(V);
String p = (V==U) ? "" : "prime_";
String U... | [
"private",
"final",
"void",
"print",
"(",
"Object",
"[",
"]",
"kvs",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"len",
"(",
"kvs",
")",
";",
"i",
"++",
")",
"{",
"Object",
"K",
"=",
"key",
"(",
"kvs",
",",
"i",
")",
";",
"... | print the entire state of the table | [
"print",
"the",
"entire",
"state",
"of",
"the",
"table"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingIdentityHashMap.java#L203-L220 |
131,002 | h2oai/h2o-3 | h2o-core/src/main/java/water/nbhm/NonBlockingIdentityHashMap.java | NonBlockingIdentityHashMap.print2 | private final void print2( Object[] kvs) {
for( int i=0; i<len(kvs); i++ ) {
Object key = key(kvs,i);
Object val = val(kvs,i);
Object U = Prime.unbox(val);
if( key != null && key != TOMBSTONE && // key is sane
val != null && U != TOMBSTONE ) { // val is sane
String p = (... | java | private final void print2( Object[] kvs) {
for( int i=0; i<len(kvs); i++ ) {
Object key = key(kvs,i);
Object val = val(kvs,i);
Object U = Prime.unbox(val);
if( key != null && key != TOMBSTONE && // key is sane
val != null && U != TOMBSTONE ) { // val is sane
String p = (... | [
"private",
"final",
"void",
"print2",
"(",
"Object",
"[",
"]",
"kvs",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"len",
"(",
"kvs",
")",
";",
"i",
"++",
")",
"{",
"Object",
"key",
"=",
"key",
"(",
"kvs",
",",
"i",
")",
";",
... | print only the live values, broken down by the table they are in | [
"print",
"only",
"the",
"live",
"values",
"broken",
"down",
"by",
"the",
"table",
"they",
"are",
"in"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingIdentityHashMap.java#L222-L238 |
131,003 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.setCompletion | private int setCompletion(int completion) {
for (int s;;) {
if ((s = status) < 0)
return s;
if (U.compareAndSwapInt(this, STATUS, s, s | completion)) {
if ((s >>> 16) != 0)
synchronized (this) { notifyAll(); }
return com... | java | private int setCompletion(int completion) {
for (int s;;) {
if ((s = status) < 0)
return s;
if (U.compareAndSwapInt(this, STATUS, s, s | completion)) {
if ((s >>> 16) != 0)
synchronized (this) { notifyAll(); }
return com... | [
"private",
"int",
"setCompletion",
"(",
"int",
"completion",
")",
"{",
"for",
"(",
"int",
"s",
";",
";",
")",
"{",
"if",
"(",
"(",
"s",
"=",
"status",
")",
"<",
"0",
")",
"return",
"s",
";",
"if",
"(",
"U",
".",
"compareAndSwapInt",
"(",
"this",
... | Marks completion and wakes up threads waiting to join this
task.
@param completion one of NORMAL, CANCELLED, EXCEPTIONAL
@return completion status on exit | [
"Marks",
"completion",
"and",
"wakes",
"up",
"threads",
"waiting",
"to",
"join",
"this",
"task",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L240-L250 |
131,004 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.doExec | final int doExec() {
int s; boolean completed;
if ((s = status) >= 0) {
try {
completed = exec();
} catch (Throwable rex) {
return setExceptionalCompletion(rex);
}
if (completed)
s = setCompletion(NORMAL);
... | java | final int doExec() {
int s; boolean completed;
if ((s = status) >= 0) {
try {
completed = exec();
} catch (Throwable rex) {
return setExceptionalCompletion(rex);
}
if (completed)
s = setCompletion(NORMAL);
... | [
"final",
"int",
"doExec",
"(",
")",
"{",
"int",
"s",
";",
"boolean",
"completed",
";",
"if",
"(",
"(",
"s",
"=",
"status",
")",
">=",
"0",
")",
"{",
"try",
"{",
"completed",
"=",
"exec",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"rex",
")"... | Primary execution method for stolen tasks. Unless done, calls
exec and records status if completed, but doesn't wait for
completion otherwise.
@return status on exit from this method | [
"Primary",
"execution",
"method",
"for",
"stolen",
"tasks",
".",
"Unless",
"done",
"calls",
"exec",
"and",
"records",
"status",
"if",
"completed",
"but",
"doesn",
"t",
"wait",
"for",
"completion",
"otherwise",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L259-L271 |
131,005 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.trySetSignal | final boolean trySetSignal() {
int s = status;
return s >= 0 && U.compareAndSwapInt(this, STATUS, s, s | SIGNAL);
} | java | final boolean trySetSignal() {
int s = status;
return s >= 0 && U.compareAndSwapInt(this, STATUS, s, s | SIGNAL);
} | [
"final",
"boolean",
"trySetSignal",
"(",
")",
"{",
"int",
"s",
"=",
"status",
";",
"return",
"s",
">=",
"0",
"&&",
"U",
".",
"compareAndSwapInt",
"(",
"this",
",",
"STATUS",
",",
"s",
",",
"s",
"|",
"SIGNAL",
")",
";",
"}"
] | Tries to set SIGNAL status unless already completed. Used by
ForkJoinPool. Other variants are directly incorporated into
externalAwaitDone etc.
@return true if successful | [
"Tries",
"to",
"set",
"SIGNAL",
"status",
"unless",
"already",
"completed",
".",
"Used",
"by",
"ForkJoinPool",
".",
"Other",
"variants",
"are",
"directly",
"incorporated",
"into",
"externalAwaitDone",
"etc",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L280-L283 |
131,006 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.doJoin | private int doJoin() {
int s; Thread t; ForkJoinWorkerThread wt; ForkJoinPool.WorkQueue w;
if ((s = status) >= 0) {
if (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)) {
if (!(w = (wt = (ForkJoinWorkerThread)t).workQueue).
tryUnpush(this) |... | java | private int doJoin() {
int s; Thread t; ForkJoinWorkerThread wt; ForkJoinPool.WorkQueue w;
if ((s = status) >= 0) {
if (((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)) {
if (!(w = (wt = (ForkJoinWorkerThread)t).workQueue).
tryUnpush(this) |... | [
"private",
"int",
"doJoin",
"(",
")",
"{",
"int",
"s",
";",
"Thread",
"t",
";",
"ForkJoinWorkerThread",
"wt",
";",
"ForkJoinPool",
".",
"WorkQueue",
"w",
";",
"if",
"(",
"(",
"s",
"=",
"status",
")",
">=",
"0",
")",
"{",
"if",
"(",
"(",
"(",
"t",... | Implementation for join, get, quietlyJoin. Directly handles
only cases of already-completed, external wait, and
unfork+exec. Others are relayed to ForkJoinPool.awaitJoin.
@return status upon completion | [
"Implementation",
"for",
"join",
"get",
"quietlyJoin",
".",
"Directly",
"handles",
"only",
"cases",
"of",
"already",
"-",
"completed",
"external",
"wait",
"and",
"unfork",
"+",
"exec",
".",
"Others",
"are",
"relayed",
"to",
"ForkJoinPool",
".",
"awaitJoin",
".... | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L339-L351 |
131,007 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.doInvoke | private int doInvoke() {
int s; Thread t; ForkJoinWorkerThread wt;
if ((s = doExec()) >= 0) {
if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
s = (wt = (ForkJoinWorkerThread)t).pool.awaitJoin(wt.workQueue,
... | java | private int doInvoke() {
int s; Thread t; ForkJoinWorkerThread wt;
if ((s = doExec()) >= 0) {
if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
s = (wt = (ForkJoinWorkerThread)t).pool.awaitJoin(wt.workQueue,
... | [
"private",
"int",
"doInvoke",
"(",
")",
"{",
"int",
"s",
";",
"Thread",
"t",
";",
"ForkJoinWorkerThread",
"wt",
";",
"if",
"(",
"(",
"s",
"=",
"doExec",
"(",
")",
")",
">=",
"0",
")",
"{",
"if",
"(",
"(",
"t",
"=",
"Thread",
".",
"currentThread",... | Implementation for invoke, quietlyInvoke.
@return status upon completion | [
"Implementation",
"for",
"invoke",
"quietlyInvoke",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L358-L368 |
131,008 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.recordExceptionalCompletion | final int recordExceptionalCompletion(Throwable ex) {
int s;
if ((s = status) >= 0) {
int h = System.identityHashCode(this);
final ReentrantLock lock = exceptionTableLock;
lock.lock();
try {
expungeStaleExceptions();
Excepti... | java | final int recordExceptionalCompletion(Throwable ex) {
int s;
if ((s = status) >= 0) {
int h = System.identityHashCode(this);
final ReentrantLock lock = exceptionTableLock;
lock.lock();
try {
expungeStaleExceptions();
Excepti... | [
"final",
"int",
"recordExceptionalCompletion",
"(",
"Throwable",
"ex",
")",
"{",
"int",
"s",
";",
"if",
"(",
"(",
"s",
"=",
"status",
")",
">=",
"0",
")",
"{",
"int",
"h",
"=",
"System",
".",
"identityHashCode",
"(",
"this",
")",
";",
"final",
"Reent... | Records exception and sets status.
@return status on exit | [
"Records",
"exception",
"and",
"sets",
"status",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L419-L443 |
131,009 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.setExceptionalCompletion | private int setExceptionalCompletion(Throwable ex) {
int s = recordExceptionalCompletion(ex);
if ((s & DONE_MASK) == EXCEPTIONAL)
internalPropagateException(ex);
return s;
} | java | private int setExceptionalCompletion(Throwable ex) {
int s = recordExceptionalCompletion(ex);
if ((s & DONE_MASK) == EXCEPTIONAL)
internalPropagateException(ex);
return s;
} | [
"private",
"int",
"setExceptionalCompletion",
"(",
"Throwable",
"ex",
")",
"{",
"int",
"s",
"=",
"recordExceptionalCompletion",
"(",
"ex",
")",
";",
"if",
"(",
"(",
"s",
"&",
"DONE_MASK",
")",
"==",
"EXCEPTIONAL",
")",
"internalPropagateException",
"(",
"ex",
... | Records exception and possibly propagates
@return status on exit | [
"Records",
"exception",
"and",
"possibly",
"propagates"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L450-L455 |
131,010 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.cancelIgnoringExceptions | static final void cancelIgnoringExceptions(ForkJoinTask<?> t) {
if (t != null && t.status >= 0) {
try {
t.cancel(false);
} catch (Throwable ignore) {
}
}
} | java | static final void cancelIgnoringExceptions(ForkJoinTask<?> t) {
if (t != null && t.status >= 0) {
try {
t.cancel(false);
} catch (Throwable ignore) {
}
}
} | [
"static",
"final",
"void",
"cancelIgnoringExceptions",
"(",
"ForkJoinTask",
"<",
"?",
">",
"t",
")",
"{",
"if",
"(",
"t",
"!=",
"null",
"&&",
"t",
".",
"status",
">=",
"0",
")",
"{",
"try",
"{",
"t",
".",
"cancel",
"(",
"false",
")",
";",
"}",
"c... | Cancels, ignoring any exceptions thrown by cancel. Used during
worker and pool shutdown. Cancel is spec'ed not to throw any
exceptions, but if it does anyway, we have no recourse during
shutdown, so guard against this case. | [
"Cancels",
"ignoring",
"any",
"exceptions",
"thrown",
"by",
"cancel",
".",
"Used",
"during",
"worker",
"and",
"pool",
"shutdown",
".",
"Cancel",
"is",
"spec",
"ed",
"not",
"to",
"throw",
"any",
"exceptions",
"but",
"if",
"it",
"does",
"anyway",
"we",
"have... | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L469-L476 |
131,011 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.clearExceptionalCompletion | private void clearExceptionalCompletion() {
int h = System.identityHashCode(this);
final ReentrantLock lock = exceptionTableLock;
lock.lock();
try {
ExceptionNode[] t = exceptionTable;
int i = h & (t.length - 1);
ExceptionNode e = t[i];
Exc... | java | private void clearExceptionalCompletion() {
int h = System.identityHashCode(this);
final ReentrantLock lock = exceptionTableLock;
lock.lock();
try {
ExceptionNode[] t = exceptionTable;
int i = h & (t.length - 1);
ExceptionNode e = t[i];
Exc... | [
"private",
"void",
"clearExceptionalCompletion",
"(",
")",
"{",
"int",
"h",
"=",
"System",
".",
"identityHashCode",
"(",
"this",
")",
";",
"final",
"ReentrantLock",
"lock",
"=",
"exceptionTableLock",
";",
"lock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"Ex... | Removes exception node and clears status | [
"Removes",
"exception",
"node",
"and",
"clears",
"status"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L481-L507 |
131,012 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.expungeStaleExceptions | private static void expungeStaleExceptions() {
for (Object x; (x = exceptionTableRefQueue.poll()) != null;) {
if (x instanceof ExceptionNode) {
ForkJoinTask<?> key = ((ExceptionNode)x).get();
ExceptionNode[] t = exceptionTable;
int i = System.identityH... | java | private static void expungeStaleExceptions() {
for (Object x; (x = exceptionTableRefQueue.poll()) != null;) {
if (x instanceof ExceptionNode) {
ForkJoinTask<?> key = ((ExceptionNode)x).get();
ExceptionNode[] t = exceptionTable;
int i = System.identityH... | [
"private",
"static",
"void",
"expungeStaleExceptions",
"(",
")",
"{",
"for",
"(",
"Object",
"x",
";",
"(",
"x",
"=",
"exceptionTableRefQueue",
".",
"poll",
"(",
")",
")",
"!=",
"null",
";",
")",
"{",
"if",
"(",
"x",
"instanceof",
"ExceptionNode",
")",
... | Poll stale refs and remove them. Call only while holding lock. | [
"Poll",
"stale",
"refs",
"and",
"remove",
"them",
".",
"Call",
"only",
"while",
"holding",
"lock",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L569-L591 |
131,013 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.reportException | private void reportException(int s) {
Throwable ex = ((s == CANCELLED) ? new CancellationException() :
(s == EXCEPTIONAL) ? getThrowableException() :
null);
if (ex != null)
U.throwException(ex);
} | java | private void reportException(int s) {
Throwable ex = ((s == CANCELLED) ? new CancellationException() :
(s == EXCEPTIONAL) ? getThrowableException() :
null);
if (ex != null)
U.throwException(ex);
} | [
"private",
"void",
"reportException",
"(",
"int",
"s",
")",
"{",
"Throwable",
"ex",
"=",
"(",
"(",
"s",
"==",
"CANCELLED",
")",
"?",
"new",
"CancellationException",
"(",
")",
":",
"(",
"s",
"==",
"EXCEPTIONAL",
")",
"?",
"getThrowableException",
"(",
")"... | Throws exception, if any, associated with the given status. | [
"Throws",
"exception",
"if",
"any",
"associated",
"with",
"the",
"given",
"status",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L611-L617 |
131,014 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.getPool | public static ForkJoinPool getPool() {
Thread t = Thread.currentThread();
return (t instanceof ForkJoinWorkerThread) ?
((ForkJoinWorkerThread) t).pool : null;
} | java | public static ForkJoinPool getPool() {
Thread t = Thread.currentThread();
return (t instanceof ForkJoinWorkerThread) ?
((ForkJoinWorkerThread) t).pool : null;
} | [
"public",
"static",
"ForkJoinPool",
"getPool",
"(",
")",
"{",
"Thread",
"t",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"return",
"(",
"t",
"instanceof",
"ForkJoinWorkerThread",
")",
"?",
"(",
"(",
"ForkJoinWorkerThread",
")",
"t",
")",
".",
"pool... | Returns the pool hosting the current task execution, or null
if this task is executing outside of any ForkJoinPool.
@see #inForkJoinPool
@return the pool, or {@code null} if none | [
"Returns",
"the",
"pool",
"hosting",
"the",
"current",
"task",
"execution",
"or",
"null",
"if",
"this",
"task",
"is",
"executing",
"outside",
"of",
"any",
"ForkJoinPool",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L1114-L1118 |
131,015 | h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/ForkJoinTask.java | ForkJoinTask.setForkJoinTaskTag | public final short setForkJoinTaskTag(short tag) {
for (int s;;) {
if (U.compareAndSwapInt(this, STATUS, s = status,
(s & ~SMASK) | (tag & SMASK)))
return (short)s;
}
} | java | public final short setForkJoinTaskTag(short tag) {
for (int s;;) {
if (U.compareAndSwapInt(this, STATUS, s = status,
(s & ~SMASK) | (tag & SMASK)))
return (short)s;
}
} | [
"public",
"final",
"short",
"setForkJoinTaskTag",
"(",
"short",
"tag",
")",
"{",
"for",
"(",
"int",
"s",
";",
";",
")",
"{",
"if",
"(",
"U",
".",
"compareAndSwapInt",
"(",
"this",
",",
"STATUS",
",",
"s",
"=",
"status",
",",
"(",
"s",
"&",
"~",
"... | Atomically sets the tag value for this task.
@param tag the tag value
@return the previous value of the tag
@since 1.8 | [
"Atomically",
"sets",
"the",
"tag",
"value",
"for",
"this",
"task",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/ForkJoinTask.java#L1361-L1367 |
131,016 | h2oai/h2o-3 | h2o-core/src/main/java/water/fvec/NewChunk.java | NewChunk.isNA2 | protected final boolean isNA2(int idx) {
if (isString()) return _is[idx] == -1;
if(isUUID() || _ds == null) return _missing != null && _missing.get(idx);
return Double.isNaN(_ds[idx]);
} | java | protected final boolean isNA2(int idx) {
if (isString()) return _is[idx] == -1;
if(isUUID() || _ds == null) return _missing != null && _missing.get(idx);
return Double.isNaN(_ds[idx]);
} | [
"protected",
"final",
"boolean",
"isNA2",
"(",
"int",
"idx",
")",
"{",
"if",
"(",
"isString",
"(",
")",
")",
"return",
"_is",
"[",
"idx",
"]",
"==",
"-",
"1",
";",
"if",
"(",
"isUUID",
"(",
")",
"||",
"_ds",
"==",
"null",
")",
"return",
"_missing... | what about sparse reps? | [
"what",
"about",
"sparse",
"reps?"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/fvec/NewChunk.java#L452-L456 |
131,017 | h2oai/h2o-3 | h2o-core/src/main/java/water/fvec/NewChunk.java | NewChunk.append2slowstr | private void append2slowstr() {
// In case of all NAs and then a string, convert NAs to string NAs
if (_xs != null) {
_xs = null; _ms = null;
alloc_str_indices(_sparseLen);
Arrays.fill(_is,-1);
}
if(_is != null && _is.length > 0){
// Check for sparseness
if(_id == null){
... | java | private void append2slowstr() {
// In case of all NAs and then a string, convert NAs to string NAs
if (_xs != null) {
_xs = null; _ms = null;
alloc_str_indices(_sparseLen);
Arrays.fill(_is,-1);
}
if(_is != null && _is.length > 0){
// Check for sparseness
if(_id == null){
... | [
"private",
"void",
"append2slowstr",
"(",
")",
"{",
"// In case of all NAs and then a string, convert NAs to string NAs",
"if",
"(",
"_xs",
"!=",
"null",
")",
"{",
"_xs",
"=",
"null",
";",
"_ms",
"=",
"null",
";",
"alloc_str_indices",
"(",
"_sparseLen",
")",
";",
... | Slow-path append string | [
"Slow",
"-",
"path",
"append",
"string"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/fvec/NewChunk.java#L872-L903 |
131,018 | h2oai/h2o-3 | h2o-core/src/main/java/water/fvec/NewChunk.java | NewChunk.compress | public Chunk compress() {
Chunk res = compress2();
byte type = type();
assert _vec == null || // Various testing scenarios do not set a Vec
type == _vec._type || // Equal types
// Allow all-bad Chunks in any type of Vec
type == Vec.T_BAD ||
// Specifically allow the NewChunk to be a... | java | public Chunk compress() {
Chunk res = compress2();
byte type = type();
assert _vec == null || // Various testing scenarios do not set a Vec
type == _vec._type || // Equal types
// Allow all-bad Chunks in any type of Vec
type == Vec.T_BAD ||
// Specifically allow the NewChunk to be a... | [
"public",
"Chunk",
"compress",
"(",
")",
"{",
"Chunk",
"res",
"=",
"compress2",
"(",
")",
";",
"byte",
"type",
"=",
"type",
"(",
")",
";",
"assert",
"_vec",
"==",
"null",
"||",
"// Various testing scenarios do not set a Vec",
"type",
"==",
"_vec",
".",
"_t... | Return the data so compressed. | [
"Return",
"the",
"data",
"so",
"compressed",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/fvec/NewChunk.java#L1080-L1107 |
131,019 | h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/utils/StringEscapeUtils.java | StringEscapeUtils.escapeNewlines | public static String escapeNewlines(String str) {
final int len = str.length();
StringWriter out = new StringWriter(len * 2);
for (int i = 0; i < len; i++) {
char c = str.charAt(i);
switch (c) {
case '\\':
out.write('\\');
out.write('\\');
break;
cas... | java | public static String escapeNewlines(String str) {
final int len = str.length();
StringWriter out = new StringWriter(len * 2);
for (int i = 0; i < len; i++) {
char c = str.charAt(i);
switch (c) {
case '\\':
out.write('\\');
out.write('\\');
break;
cas... | [
"public",
"static",
"String",
"escapeNewlines",
"(",
"String",
"str",
")",
"{",
"final",
"int",
"len",
"=",
"str",
".",
"length",
"(",
")",
";",
"StringWriter",
"out",
"=",
"new",
"StringWriter",
"(",
"len",
"*",
"2",
")",
";",
"for",
"(",
"int",
"i"... | Escapes new line characters of a given string.
It also escapes the forward slash characters.
@param str string to be escaped
@return escaped string | [
"Escapes",
"new",
"line",
"characters",
"of",
"a",
"given",
"string",
".",
"It",
"also",
"escapes",
"the",
"forward",
"slash",
"characters",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/utils/StringEscapeUtils.java#L13-L32 |
131,020 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/Session.java | Session.exec | public Val exec(AstRoot ast, AstFunction scope) {
sanity_check_refs(null);
// Execute
Env env = new Env(this);
env._scope = scope;
Val val = ast.exec(env); // Execute
assert env.sp() == 0; // Stack balanced at end
sanity_check_refs(val);
return val; // Can ret... | java | public Val exec(AstRoot ast, AstFunction scope) {
sanity_check_refs(null);
// Execute
Env env = new Env(this);
env._scope = scope;
Val val = ast.exec(env); // Execute
assert env.sp() == 0; // Stack balanced at end
sanity_check_refs(val);
return val; // Can ret... | [
"public",
"Val",
"exec",
"(",
"AstRoot",
"ast",
",",
"AstFunction",
"scope",
")",
"{",
"sanity_check_refs",
"(",
"null",
")",
";",
"// Execute",
"Env",
"env",
"=",
"new",
"Env",
"(",
"this",
")",
";",
"env",
".",
"_scope",
"=",
"scope",
";",
"Val",
"... | Execute an AstRoot in the current Session with much assertion-checking
@param ast Rapids expression to execute
@param scope ?
@return the result from the Rapids expression | [
"Execute",
"an",
"AstRoot",
"in",
"the",
"current",
"Session",
"with",
"much",
"assertion",
"-",
"checking"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/Session.java#L82-L92 |
131,021 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/Session.java | Session.endQuietly | public RuntimeException endQuietly(Throwable ex) {
try {
GLOBALS.clear();
Futures fs = new Futures();
for (Frame fr : FRAMES.values()) {
for (Key<Vec> vec : fr.keys()) {
Integer I = REFCNTS.get(vec);
int i = (I == null ? 0 : I) - 1;
if (i > 0) REFCNTS.put(vec,... | java | public RuntimeException endQuietly(Throwable ex) {
try {
GLOBALS.clear();
Futures fs = new Futures();
for (Frame fr : FRAMES.values()) {
for (Key<Vec> vec : fr.keys()) {
Integer I = REFCNTS.get(vec);
int i = (I == null ? 0 : I) - 1;
if (i > 0) REFCNTS.put(vec,... | [
"public",
"RuntimeException",
"endQuietly",
"(",
"Throwable",
"ex",
")",
"{",
"try",
"{",
"GLOBALS",
".",
"clear",
"(",
")",
";",
"Futures",
"fs",
"=",
"new",
"Futures",
"(",
")",
";",
"for",
"(",
"Frame",
"fr",
":",
"FRAMES",
".",
"values",
"(",
")"... | The Rapids call threw an exception. Best-effort cleanup, no more exceptions | [
"The",
"Rapids",
"call",
"threw",
"an",
"exception",
".",
"Best",
"-",
"effort",
"cleanup",
"no",
"more",
"exceptions"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/Session.java#L128-L151 |
131,022 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/Session.java | Session._addRefCnt | private int _addRefCnt(Key<Vec> vec, int i) {
return _putRefCnt(vec, _getRefCnt(vec) + i);
} | java | private int _addRefCnt(Key<Vec> vec, int i) {
return _putRefCnt(vec, _getRefCnt(vec) + i);
} | [
"private",
"int",
"_addRefCnt",
"(",
"Key",
"<",
"Vec",
">",
"vec",
",",
"int",
"i",
")",
"{",
"return",
"_putRefCnt",
"(",
"vec",
",",
"_getRefCnt",
"(",
"vec",
")",
"+",
"i",
")",
";",
"}"
] | Bump internal count, not counting globals | [
"Bump",
"internal",
"count",
"not",
"counting",
"globals"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/Session.java#L173-L175 |
131,023 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/Session.java | Session.addRefCnt | private int addRefCnt(Key<Vec> vec, int i) {
return _addRefCnt(vec, i) + (GLOBALS.contains(vec) ? 1 : 0);
} | java | private int addRefCnt(Key<Vec> vec, int i) {
return _addRefCnt(vec, i) + (GLOBALS.contains(vec) ? 1 : 0);
} | [
"private",
"int",
"addRefCnt",
"(",
"Key",
"<",
"Vec",
">",
"vec",
",",
"int",
"i",
")",
"{",
"return",
"_addRefCnt",
"(",
"vec",
",",
"i",
")",
"+",
"(",
"GLOBALS",
".",
"contains",
"(",
"vec",
")",
"?",
"1",
":",
"0",
")",
";",
"}"
] | RefCnt +i this Vec; Global Refs can be alive with zero internal counts | [
"RefCnt",
"+",
"i",
"this",
"Vec",
";",
"Global",
"Refs",
"can",
"be",
"alive",
"with",
"zero",
"internal",
"counts"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/Session.java#L187-L189 |
131,024 | h2oai/h2o-3 | h2o-core/src/main/java/hex/createframe/postprocess/MissingInserterCfps.java | MissingInserterCfps.exec | @Override
public void exec(Frame fr, Random rng) {
// No need to do anything if p == 0
if (p > 0)
new InsertNAs(p, rng).doAll(fr);
} | java | @Override
public void exec(Frame fr, Random rng) {
// No need to do anything if p == 0
if (p > 0)
new InsertNAs(p, rng).doAll(fr);
} | [
"@",
"Override",
"public",
"void",
"exec",
"(",
"Frame",
"fr",
",",
"Random",
"rng",
")",
"{",
"// No need to do anything if p == 0",
"if",
"(",
"p",
">",
"0",
")",
"new",
"InsertNAs",
"(",
"p",
",",
"rng",
")",
".",
"doAll",
"(",
"fr",
")",
";",
"}"... | Execute this post-processing step. | [
"Execute",
"this",
"post",
"-",
"processing",
"step",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/createframe/postprocess/MissingInserterCfps.java#L30-L35 |
131,025 | h2oai/h2o-3 | h2o-core/src/main/java/water/init/NetworkInit.java | NetworkInit.getInetAddress | private static InetAddress getInetAddress(String ip) {
if (ip == null)
return null;
InetAddress addr = null;
try {
addr = InetAddress.getByName(ip);
} catch (UnknownHostException e) {
Log.err(e);
H2O.exit(-1);
}
return addr;
} | java | private static InetAddress getInetAddress(String ip) {
if (ip == null)
return null;
InetAddress addr = null;
try {
addr = InetAddress.getByName(ip);
} catch (UnknownHostException e) {
Log.err(e);
H2O.exit(-1);
}
return addr;
} | [
"private",
"static",
"InetAddress",
"getInetAddress",
"(",
"String",
"ip",
")",
"{",
"if",
"(",
"ip",
"==",
"null",
")",
"return",
"null",
";",
"InetAddress",
"addr",
"=",
"null",
";",
"try",
"{",
"addr",
"=",
"InetAddress",
".",
"getByName",
"(",
"ip",
... | Get address for given IP.
@param ip textual representation of IP (host)
@return IPv4 or IPv6 address which matches given IP and is in specified range | [
"Get",
"address",
"for",
"given",
"IP",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/init/NetworkInit.java#L258-L270 |
131,026 | h2oai/h2o-3 | h2o-algos/src/main/java/hex/ensemble/StackedEnsembleModel.java | StackedEnsembleModel.predictScoreImpl | @Override
protected Frame predictScoreImpl(Frame fr, Frame adaptFrm, String destination_key, Job j, boolean computeMetrics, CFuncRef customMetricFunc) {
Frame levelOneFrame = new Frame(Key.<Frame>make("preds_levelone_" + this._key.toString() + fr._key));
// TODO: don't score models that have 0 coefficients /... | java | @Override
protected Frame predictScoreImpl(Frame fr, Frame adaptFrm, String destination_key, Job j, boolean computeMetrics, CFuncRef customMetricFunc) {
Frame levelOneFrame = new Frame(Key.<Frame>make("preds_levelone_" + this._key.toString() + fr._key));
// TODO: don't score models that have 0 coefficients /... | [
"@",
"Override",
"protected",
"Frame",
"predictScoreImpl",
"(",
"Frame",
"fr",
",",
"Frame",
"adaptFrm",
",",
"String",
"destination_key",
",",
"Job",
"j",
",",
"boolean",
"computeMetrics",
",",
"CFuncRef",
"customMetricFunc",
")",
"{",
"Frame",
"levelOneFrame",
... | For StackedEnsemble we call score on all the base_models and then combine the results
with the metalearner to create the final predictions frame.
@see Model#predictScoreImpl(Frame, Frame, String, Job, boolean, CFuncRef)
@param adaptFrm Already adapted frame
@param computeMetrics
@return A Frame containing the predicti... | [
"For",
"StackedEnsemble",
"we",
"call",
"score",
"on",
"all",
"the",
"base_models",
"and",
"then",
"combine",
"the",
"results",
"with",
"the",
"metalearner",
"to",
"create",
"the",
"final",
"predictions",
"frame",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/ensemble/StackedEnsembleModel.java#L120-L168 |
131,027 | h2oai/h2o-3 | h2o-parsers/h2o-avro-parser/src/main/java/water/parser/avro/AvroParser.java | AvroParser.write2frame | private static void write2frame(GenericRecord gr, String[] columnNames, Schema.Field[] inSchema, byte[] columnTypes, ParseWriter dout) {
assert inSchema.length == columnTypes.length : "AVRO field flatenized schema has to match to parser setup";
BufferedString bs = new BufferedString();
for (int cIdx = 0; cI... | java | private static void write2frame(GenericRecord gr, String[] columnNames, Schema.Field[] inSchema, byte[] columnTypes, ParseWriter dout) {
assert inSchema.length == columnTypes.length : "AVRO field flatenized schema has to match to parser setup";
BufferedString bs = new BufferedString();
for (int cIdx = 0; cI... | [
"private",
"static",
"void",
"write2frame",
"(",
"GenericRecord",
"gr",
",",
"String",
"[",
"]",
"columnNames",
",",
"Schema",
".",
"Field",
"[",
"]",
"inSchema",
",",
"byte",
"[",
"]",
"columnTypes",
",",
"ParseWriter",
"dout",
")",
"{",
"assert",
"inSche... | The main method transforming Avro record into a row in H2O frame.
@param gr Avro generic record
@param columnNames Column names prepared by parser setup
@param inSchema Flattenized Avro schema which corresponds to passed column names
@param columnTypes Target H2O types
@param dout Parser writer | [
"The",
"main",
"method",
"transforming",
"Avro",
"record",
"into",
"a",
"row",
"in",
"H2O",
"frame",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-parsers/h2o-avro-parser/src/main/java/water/parser/avro/AvroParser.java#L208-L253 |
131,028 | h2oai/h2o-3 | h2o-automl/src/main/java/water/automl/api/LeaderboardsHandler.java | LeaderboardsHandler.list | @SuppressWarnings("unused") // called through reflection by RequestServer
public water.automl.api.schemas3.LeaderboardsV99 list(int version, water.automl.api.schemas3.LeaderboardsV99 s) {
Leaderboards m = s.createAndFillImpl();
m.leaderboards = Leaderboards.fetchAll();
return s.fillFromImpl(m);
} | java | @SuppressWarnings("unused") // called through reflection by RequestServer
public water.automl.api.schemas3.LeaderboardsV99 list(int version, water.automl.api.schemas3.LeaderboardsV99 s) {
Leaderboards m = s.createAndFillImpl();
m.leaderboards = Leaderboards.fetchAll();
return s.fillFromImpl(m);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"// called through reflection by RequestServer",
"public",
"water",
".",
"automl",
".",
"api",
".",
"schemas3",
".",
"LeaderboardsV99",
"list",
"(",
"int",
"version",
",",
"water",
".",
"automl",
".",
"api",
".",
... | Return all the Leaderboards. | [
"Return",
"all",
"the",
"Leaderboards",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-automl/src/main/java/water/automl/api/LeaderboardsHandler.java#L37-L42 |
131,029 | h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/algos/deepwater/caffe/DeepwaterCaffeBackend.java | DeepwaterCaffeBackend.train | @Override
public float[]/*ignored*/ train(BackendModel m, float[/*mini_batch * input_neurons*/] data, float[/*mini_batch*/] label) {
((DeepwaterCaffeModel) m).train(data, label);
return null; //return value is always ignored
} | java | @Override
public float[]/*ignored*/ train(BackendModel m, float[/*mini_batch * input_neurons*/] data, float[/*mini_batch*/] label) {
((DeepwaterCaffeModel) m).train(data, label);
return null; //return value is always ignored
} | [
"@",
"Override",
"public",
"float",
"[",
"]",
"/*ignored*/",
"train",
"(",
"BackendModel",
"m",
",",
"float",
"[",
"/*mini_batch * input_neurons*/",
"]",
"data",
",",
"float",
"[",
"/*mini_batch*/",
"]",
"label",
")",
"{",
"(",
"(",
"DeepwaterCaffeModel",
")",... | given a mini-batch worth of data and labels, train | [
"given",
"a",
"mini",
"-",
"batch",
"worth",
"of",
"data",
"and",
"labels",
"train"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/algos/deepwater/caffe/DeepwaterCaffeBackend.java#L107-L111 |
131,030 | h2oai/h2o-3 | h2o-core/src/main/java/water/nbhm/NonBlockingHashMapLong.java | NonBlockingHashMapLong.print | public final void print() {
System.out.println("=========");
print_impl(-99,NO_KEY,_val_1);
_chm.print();
System.out.println("=========");
} | java | public final void print() {
System.out.println("=========");
print_impl(-99,NO_KEY,_val_1);
_chm.print();
System.out.println("=========");
} | [
"public",
"final",
"void",
"print",
"(",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"=========\"",
")",
";",
"print_impl",
"(",
"-",
"99",
",",
"NO_KEY",
",",
"_val_1",
")",
";",
"_chm",
".",
"print",
"(",
")",
";",
"System",
".",
"out"... | Verbose printout of table internals, useful for debugging. | [
"Verbose",
"printout",
"of",
"table",
"internals",
"useful",
"for",
"debugging",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingHashMapLong.java#L168-L173 |
131,031 | h2oai/h2o-3 | h2o-core/src/main/java/water/nbhm/NonBlockingHashMapLong.java | NonBlockingHashMapLong.keySetLong | public long[] keySetLong() {
long[] dom = new long[size()];
IteratorLong i=(IteratorLong)keySet().iterator();
int j=0;
while( j < dom.length && i.hasNext() )
dom[j++] = i.nextLong();
return dom;
} | java | public long[] keySetLong() {
long[] dom = new long[size()];
IteratorLong i=(IteratorLong)keySet().iterator();
int j=0;
while( j < dom.length && i.hasNext() )
dom[j++] = i.nextLong();
return dom;
} | [
"public",
"long",
"[",
"]",
"keySetLong",
"(",
")",
"{",
"long",
"[",
"]",
"dom",
"=",
"new",
"long",
"[",
"size",
"(",
")",
"]",
";",
"IteratorLong",
"i",
"=",
"(",
"IteratorLong",
")",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"int",
... | Keys as a long array. Array may be zero-padded if keys are concurrently deleted. | [
"Keys",
"as",
"a",
"long",
"array",
".",
"Array",
"may",
"be",
"zero",
"-",
"padded",
"if",
"keys",
"are",
"concurrently",
"deleted",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/nbhm/NonBlockingHashMapLong.java#L1118-L1125 |
131,032 | h2oai/h2o-3 | h2o-core/src/main/java/water/util/TwoDimTable.java | TwoDimTable.set | public void set(final int row, final int col, final Object o) {
if (o == null)
cellValues[row][col] = new IcedWrapper(null);
else if (o instanceof Double && Double.isNaN((double)o))
cellValues[row][col] = new IcedWrapper(Double.NaN);
else if (o instanceof int[])
cellValues[row][col] = new ... | java | public void set(final int row, final int col, final Object o) {
if (o == null)
cellValues[row][col] = new IcedWrapper(null);
else if (o instanceof Double && Double.isNaN((double)o))
cellValues[row][col] = new IcedWrapper(Double.NaN);
else if (o instanceof int[])
cellValues[row][col] = new ... | [
"public",
"void",
"set",
"(",
"final",
"int",
"row",
",",
"final",
"int",
"col",
",",
"final",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"cellValues",
"[",
"row",
"]",
"[",
"col",
"]",
"=",
"new",
"IcedWrapper",
"(",
"null",
")"... | Setter for table cells
@param row a row index
@param col a column index
@param o Object value | [
"Setter",
"for",
"table",
"cells"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/TwoDimTable.java#L238-L372 |
131,033 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.parseArguments | static void parseArguments(String[] args) {
for (AbstractH2OExtension e : extManager.getCoreExtensions()) {
args = e.parseArguments(args);
}
parseH2OArgumentsTo(args, ARGS);
} | java | static void parseArguments(String[] args) {
for (AbstractH2OExtension e : extManager.getCoreExtensions()) {
args = e.parseArguments(args);
}
parseH2OArgumentsTo(args, ARGS);
} | [
"static",
"void",
"parseArguments",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"for",
"(",
"AbstractH2OExtension",
"e",
":",
"extManager",
".",
"getCoreExtensions",
"(",
")",
")",
"{",
"args",
"=",
"e",
".",
"parseArguments",
"(",
"args",
")",
";",
"}",
... | Dead stupid argument parser. | [
"Dead",
"stupid",
"argument",
"parser",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L479-L484 |
131,034 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.notifyAboutCloudSize | public static void notifyAboutCloudSize(InetAddress ip, int port, InetAddress leaderIp, int leaderPort, int size) {
if (ARGS.notify_local != null && !ARGS.notify_local.trim().isEmpty()) {
final File notifyFile = new File(ARGS.notify_local);
final File parentDir = notifyFile.getParentFile();
if (pa... | java | public static void notifyAboutCloudSize(InetAddress ip, int port, InetAddress leaderIp, int leaderPort, int size) {
if (ARGS.notify_local != null && !ARGS.notify_local.trim().isEmpty()) {
final File notifyFile = new File(ARGS.notify_local);
final File parentDir = notifyFile.getParentFile();
if (pa... | [
"public",
"static",
"void",
"notifyAboutCloudSize",
"(",
"InetAddress",
"ip",
",",
"int",
"port",
",",
"InetAddress",
"leaderIp",
",",
"int",
"leaderPort",
",",
"int",
"size",
")",
"{",
"if",
"(",
"ARGS",
".",
"notify_local",
"!=",
"null",
"&&",
"!",
"ARGS... | Tell the embedding software that this H2O instance belongs to
a cloud of a certain size.
This may be non-blocking.
@param ip IP address this H2O can be reached at.
@param port Port this H2O can be reached at (for REST API and browser).
@param size Number of H2O instances in the cloud. | [
"Tell",
"the",
"embedding",
"software",
"that",
"this",
"H2O",
"instance",
"belongs",
"to",
"a",
"cloud",
"of",
"a",
"certain",
"size",
".",
"This",
"may",
"be",
"non",
"-",
"blocking",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L760-L781 |
131,035 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.exit | public static void exit(int status) {
// Embedded H2O path (e.g. inside Hadoop mapper task).
if( embeddedH2OConfig != null )
embeddedH2OConfig.exit(status);
// Flush all cached messages
Log.flushStdout();
// Standalone H2O path,p or if the embedded config does not exit
System.exit(status)... | java | public static void exit(int status) {
// Embedded H2O path (e.g. inside Hadoop mapper task).
if( embeddedH2OConfig != null )
embeddedH2OConfig.exit(status);
// Flush all cached messages
Log.flushStdout();
// Standalone H2O path,p or if the embedded config does not exit
System.exit(status)... | [
"public",
"static",
"void",
"exit",
"(",
"int",
"status",
")",
"{",
"// Embedded H2O path (e.g. inside Hadoop mapper task).",
"if",
"(",
"embeddedH2OConfig",
"!=",
"null",
")",
"embeddedH2OConfig",
".",
"exit",
"(",
"status",
")",
";",
"// Flush all cached messages",
... | Notify embedding software instance H2O wants to exit. Shuts down a single Node.
@param status H2O's requested process exit value. | [
"Notify",
"embedding",
"software",
"instance",
"H2O",
"wants",
"to",
"exit",
".",
"Shuts",
"down",
"a",
"single",
"Node",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L795-L804 |
131,036 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.shutdown | public static void shutdown(int status) {
if(status == 0) H2O.orderlyShutdown();
UDPRebooted.T.error.send(H2O.SELF);
H2O.exit(status);
} | java | public static void shutdown(int status) {
if(status == 0) H2O.orderlyShutdown();
UDPRebooted.T.error.send(H2O.SELF);
H2O.exit(status);
} | [
"public",
"static",
"void",
"shutdown",
"(",
"int",
"status",
")",
"{",
"if",
"(",
"status",
"==",
"0",
")",
"H2O",
".",
"orderlyShutdown",
"(",
")",
";",
"UDPRebooted",
".",
"T",
".",
"error",
".",
"send",
"(",
"H2O",
".",
"SELF",
")",
";",
"H2O",... | Cluster shutdown itself by sending a shutdown UDP packet. | [
"Cluster",
"shutdown",
"itself",
"by",
"sending",
"a",
"shutdown",
"UDP",
"packet",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L807-L811 |
131,037 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.getIdleTimeMillis | public static long getIdleTimeMillis() {
long latestEndTimeMillis = -1;
// If there are any running rapids queries, consider that not idle.
if (activeRapidsExecs.get() > 0) {
updateNotIdle();
}
else {
// If there are any running jobs, consider that not idle.
// Remember the latest... | java | public static long getIdleTimeMillis() {
long latestEndTimeMillis = -1;
// If there are any running rapids queries, consider that not idle.
if (activeRapidsExecs.get() > 0) {
updateNotIdle();
}
else {
// If there are any running jobs, consider that not idle.
// Remember the latest... | [
"public",
"static",
"long",
"getIdleTimeMillis",
"(",
")",
"{",
"long",
"latestEndTimeMillis",
"=",
"-",
"1",
";",
"// If there are any running rapids queries, consider that not idle.",
"if",
"(",
"activeRapidsExecs",
".",
"get",
"(",
")",
">",
"0",
")",
"{",
"updat... | Get the number of milliseconds the H2O cluster has been idle.
@return milliseconds since the last interesting thing happened. | [
"Get",
"the",
"number",
"of",
"milliseconds",
"the",
"H2O",
"cluster",
"has",
"been",
"idle",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L998-L1031 |
131,038 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.getSysProperty | public static String getSysProperty(String name, String def) {
return System.getProperty(H2O.OptArgs.SYSTEM_PROP_PREFIX + name, def);
} | java | public static String getSysProperty(String name, String def) {
return System.getProperty(H2O.OptArgs.SYSTEM_PROP_PREFIX + name, def);
} | [
"public",
"static",
"String",
"getSysProperty",
"(",
"String",
"name",
",",
"String",
"def",
")",
"{",
"return",
"System",
".",
"getProperty",
"(",
"H2O",
".",
"OptArgs",
".",
"SYSTEM_PROP_PREFIX",
"+",
"name",
",",
"def",
")",
";",
"}"
] | Retrieves a value of an H2O system property
@param name property name
@param def default value
@return value of the system property or default value if property was not defined | [
"Retrieves",
"a",
"value",
"of",
"an",
"H2O",
"system",
"property"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1080-L1082 |
131,039 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.technote | public static String technote(int[] numbers, String message) {
StringBuilder sb = new StringBuilder()
.append(message)
.append("\n")
.append("\n")
.append("For more information visit:\n");
for (int number : numbers) {
sb.append(" http://jira.h2o.ai/browse/... | java | public static String technote(int[] numbers, String message) {
StringBuilder sb = new StringBuilder()
.append(message)
.append("\n")
.append("\n")
.append("For more information visit:\n");
for (int number : numbers) {
sb.append(" http://jira.h2o.ai/browse/... | [
"public",
"static",
"String",
"technote",
"(",
"int",
"[",
"]",
"numbers",
",",
"String",
"message",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
".",
"append",
"(",
"message",
")",
".",
"append",
"(",
"\"\\n\"",
")",
".",
"a... | Return an error message with an accompanying list of URLs to help the user get more detailed information.
@param numbers H2O tech note numbers.
@param message Message to present to the user.
@return A longer message including a list of URLs. | [
"Return",
"an",
"error",
"message",
"with",
"an",
"accompanying",
"list",
"of",
"URLs",
"to",
"help",
"the",
"user",
"get",
"more",
"detailed",
"information",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1169-L1181 |
131,040 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.submitTask | public static <T extends H2OCountedCompleter> T submitTask( T task ) {
int priority = task.priority();
if( priority < LOW_PRIORITY_API_WORK )
LOW_PRIORITY_API_WORK_CLASS = task.getClass().toString();
assert MIN_PRIORITY <= priority && priority <= MAX_PRIORITY:"priority " + priority + " is out of range... | java | public static <T extends H2OCountedCompleter> T submitTask( T task ) {
int priority = task.priority();
if( priority < LOW_PRIORITY_API_WORK )
LOW_PRIORITY_API_WORK_CLASS = task.getClass().toString();
assert MIN_PRIORITY <= priority && priority <= MAX_PRIORITY:"priority " + priority + " is out of range... | [
"public",
"static",
"<",
"T",
"extends",
"H2OCountedCompleter",
">",
"T",
"submitTask",
"(",
"T",
"task",
")",
"{",
"int",
"priority",
"=",
"task",
".",
"priority",
"(",
")",
";",
"if",
"(",
"priority",
"<",
"LOW_PRIORITY_API_WORK",
")",
"LOW_PRIORITY_API_WO... | Submit to the correct priority queue | [
"Submit",
"to",
"the",
"correct",
"priority",
"queue"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1275-L1284 |
131,041 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.runOnH2ONode | static <T extends RemoteRunnable> T runOnH2ONode(H2ONode node, T runnable) {
if (node == H2O.SELF) {
// run directly
runnable.run();
return runnable;
} else {
RunnableWrapperTask<T> task = new RunnableWrapperTask<>(runnable);
try {
return new RPC<>(node, task).call().get().... | java | static <T extends RemoteRunnable> T runOnH2ONode(H2ONode node, T runnable) {
if (node == H2O.SELF) {
// run directly
runnable.run();
return runnable;
} else {
RunnableWrapperTask<T> task = new RunnableWrapperTask<>(runnable);
try {
return new RPC<>(node, task).call().get().... | [
"static",
"<",
"T",
"extends",
"RemoteRunnable",
">",
"T",
"runOnH2ONode",
"(",
"H2ONode",
"node",
",",
"T",
"runnable",
")",
"{",
"if",
"(",
"node",
"==",
"H2O",
".",
"SELF",
")",
"{",
"// run directly",
"runnable",
".",
"run",
"(",
")",
";",
"return"... | package-private for unit tests | [
"package",
"-",
"private",
"for",
"unit",
"tests"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1305-L1320 |
131,042 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.DEFAULT_FLOW_DIR | public static String DEFAULT_FLOW_DIR() {
String flow_dir = null;
try {
if (ARGS.ga_hadoop_ver != null) {
PersistManager pm = getPM();
if (pm != null) {
String s = pm.getHdfsHomeDirectory();
if (pm.exists(s)) {
flow_dir = s;
}
}
if... | java | public static String DEFAULT_FLOW_DIR() {
String flow_dir = null;
try {
if (ARGS.ga_hadoop_ver != null) {
PersistManager pm = getPM();
if (pm != null) {
String s = pm.getHdfsHomeDirectory();
if (pm.exists(s)) {
flow_dir = s;
}
}
if... | [
"public",
"static",
"String",
"DEFAULT_FLOW_DIR",
"(",
")",
"{",
"String",
"flow_dir",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"ARGS",
".",
"ga_hadoop_ver",
"!=",
"null",
")",
"{",
"PersistManager",
"pm",
"=",
"getPM",
"(",
")",
";",
"if",
"(",
"pm",
... | Place to store flows | [
"Place",
"to",
"store",
"flows"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1532-L1557 |
131,043 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.printAndLogVersion | private static void printAndLogVersion(String[] arguments) {
Log.init(ARGS.log_level, ARGS.quiet);
Log.info("----- H2O started " + (ARGS.client?"(client)":"") + " -----");
Log.info("Build git branch: " + ABV.branchName());
Log.info("Build git hash: " + ABV.lastCommitHash());
Log.info("Build git desc... | java | private static void printAndLogVersion(String[] arguments) {
Log.init(ARGS.log_level, ARGS.quiet);
Log.info("----- H2O started " + (ARGS.client?"(client)":"") + " -----");
Log.info("Build git branch: " + ABV.branchName());
Log.info("Build git hash: " + ABV.lastCommitHash());
Log.info("Build git desc... | [
"private",
"static",
"void",
"printAndLogVersion",
"(",
"String",
"[",
"]",
"arguments",
")",
"{",
"Log",
".",
"init",
"(",
"ARGS",
".",
"log_level",
",",
"ARGS",
".",
"quiet",
")",
";",
"Log",
".",
"info",
"(",
"\"----- H2O started \"",
"+",
"(",
"ARGS"... | If logging has not been setup yet, then Log.info will only print to
stdout. This allows for early processing of the '-version' option
without unpacking the jar file and other startup stuff. | [
"If",
"logging",
"has",
"not",
"been",
"setup",
"yet",
"then",
"Log",
".",
"info",
"will",
"only",
"print",
"to",
"stdout",
".",
"This",
"allows",
"for",
"early",
"processing",
"of",
"the",
"-",
"version",
"option",
"without",
"unpacking",
"the",
"jar",
... | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1590-L1619 |
131,044 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.startLocalNode | private static void startLocalNode() {
// Figure self out; this is surprisingly hard
NetworkInit.initializeNetworkSockets();
// Do not forget to put SELF into the static configuration (to simulate proper multicast behavior)
if ( !ARGS.client && H2O.isFlatfileEnabled() && !H2O.isNodeInFlatfile(SELF)) {
... | java | private static void startLocalNode() {
// Figure self out; this is surprisingly hard
NetworkInit.initializeNetworkSockets();
// Do not forget to put SELF into the static configuration (to simulate proper multicast behavior)
if ( !ARGS.client && H2O.isFlatfileEnabled() && !H2O.isNodeInFlatfile(SELF)) {
... | [
"private",
"static",
"void",
"startLocalNode",
"(",
")",
"{",
"// Figure self out; this is surprisingly hard",
"NetworkInit",
".",
"initializeNetworkSockets",
"(",
")",
";",
"// Do not forget to put SELF into the static configuration (to simulate proper multicast behavior)",
"if",
"(... | Initializes the local node and the local cloud with itself as the only member. | [
"Initializes",
"the",
"local",
"node",
"and",
"the",
"local",
"cloud",
"with",
"itself",
"as",
"the",
"only",
"member",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1622-L1648 |
131,045 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.startNetworkServices | private static void startNetworkServices() {
// We've rebooted the JVM recently. Tell other Nodes they can ignore task
// prior tasks by us. Do this before we receive any packets
UDPRebooted.T.reboot.broadcast();
// Start the MultiReceiverThread, to listen for multi-cast requests from
// other Clou... | java | private static void startNetworkServices() {
// We've rebooted the JVM recently. Tell other Nodes they can ignore task
// prior tasks by us. Do this before we receive any packets
UDPRebooted.T.reboot.broadcast();
// Start the MultiReceiverThread, to listen for multi-cast requests from
// other Clou... | [
"private",
"static",
"void",
"startNetworkServices",
"(",
")",
"{",
"// We've rebooted the JVM recently. Tell other Nodes they can ignore task",
"// prior tasks by us. Do this before we receive any packets",
"UDPRebooted",
".",
"T",
".",
"reboot",
".",
"broadcast",
"(",
")",
";",... | Starts the worker threads, receiver threads, heartbeats and all other
network related services. | [
"Starts",
"the",
"worker",
"threads",
"receiver",
"threads",
"heartbeats",
"and",
"all",
"other",
"network",
"related",
"services",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1652-L1672 |
131,046 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.set_next_Cloud | void set_next_Cloud( H2ONode[] h2os, int hash ) {
synchronized(this) {
int idx = _idx+1; // Unique 1-byte Cloud index
if( idx == 256 ) idx=1; // wrap, avoiding zero
CLOUDS[idx] = CLOUD = new H2O(h2os,hash,idx);
}
SELF._heartbeat._cloud_size=(char)CLOUD.size();
H2O.CLOUD._node_ip_to_in... | java | void set_next_Cloud( H2ONode[] h2os, int hash ) {
synchronized(this) {
int idx = _idx+1; // Unique 1-byte Cloud index
if( idx == 256 ) idx=1; // wrap, avoiding zero
CLOUDS[idx] = CLOUD = new H2O(h2os,hash,idx);
}
SELF._heartbeat._cloud_size=(char)CLOUD.size();
H2O.CLOUD._node_ip_to_in... | [
"void",
"set_next_Cloud",
"(",
"H2ONode",
"[",
"]",
"h2os",
",",
"int",
"hash",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"int",
"idx",
"=",
"_idx",
"+",
"1",
";",
"// Unique 1-byte Cloud index",
"if",
"(",
"idx",
"==",
"256",
")",
"idx",
"=",
... | member list. | [
"member",
"list",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1760-L1772 |
131,047 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.free_mem | public long free_mem() {
long memsz = 0;
for( H2ONode h2o : CLOUD._memary )
memsz += h2o._heartbeat.get_free_mem();
return memsz;
} | java | public long free_mem() {
long memsz = 0;
for( H2ONode h2o : CLOUD._memary )
memsz += h2o._heartbeat.get_free_mem();
return memsz;
} | [
"public",
"long",
"free_mem",
"(",
")",
"{",
"long",
"memsz",
"=",
"0",
";",
"for",
"(",
"H2ONode",
"h2o",
":",
"CLOUD",
".",
"_memary",
")",
"memsz",
"+=",
"h2o",
".",
"_heartbeat",
".",
"get_free_mem",
"(",
")",
";",
"return",
"memsz",
";",
"}"
] | Cluster free memory | [
"Cluster",
"free",
"memory"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1797-L1802 |
131,048 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.healthy | public boolean healthy() {
long now = System.currentTimeMillis();
for (H2ONode node : H2O.CLOUD.members())
if (!node.isHealthy(now))
return false;
return true;
} | java | public boolean healthy() {
long now = System.currentTimeMillis();
for (H2ONode node : H2O.CLOUD.members())
if (!node.isHealthy(now))
return false;
return true;
} | [
"public",
"boolean",
"healthy",
"(",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"for",
"(",
"H2ONode",
"node",
":",
"H2O",
".",
"CLOUD",
".",
"members",
"(",
")",
")",
"if",
"(",
"!",
"node",
".",
"isHealthy",
... | Quick health check; no reason given for bad health | [
"Quick",
"health",
"check",
";",
"no",
"reason",
"given",
"for",
"bad",
"health"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1805-L1811 |
131,049 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.joinOthers | public static void joinOthers() {
long start = System.currentTimeMillis();
while( System.currentTimeMillis() - start < 2000 ) {
if( CLOUD.size() > 1 && Paxos._commonKnowledge )
break;
try { Thread.sleep(100); } catch( InterruptedException ignore ) { }
}
} | java | public static void joinOthers() {
long start = System.currentTimeMillis();
while( System.currentTimeMillis() - start < 2000 ) {
if( CLOUD.size() > 1 && Paxos._commonKnowledge )
break;
try { Thread.sleep(100); } catch( InterruptedException ignore ) { }
}
} | [
"public",
"static",
"void",
"joinOthers",
"(",
")",
"{",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"while",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"start",
"<",
"2000",
")",
"{",
"if",
"(",
"CLOUD",
".",
... | - If nobody else is found, not an error. | [
"-",
"If",
"nobody",
"else",
"is",
"found",
"not",
"an",
"error",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1835-L1842 |
131,050 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.raw_remove | public static void raw_remove(Key key) {
Value v = STORE.remove(key);
if( v != null ) v.removePersist();
} | java | public static void raw_remove(Key key) {
Value v = STORE.remove(key);
if( v != null ) v.removePersist();
} | [
"public",
"static",
"void",
"raw_remove",
"(",
"Key",
"key",
")",
"{",
"Value",
"v",
"=",
"STORE",
".",
"remove",
"(",
"key",
")",
";",
"if",
"(",
"v",
"!=",
"null",
")",
"v",
".",
"removePersist",
"(",
")",
";",
"}"
] | Get the value from the store | [
"Get",
"the",
"value",
"from",
"the",
"store"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1898-L1901 |
131,051 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.STOREtoString | public static String STOREtoString() {
int[] cnts = new int[1];
Object[] kvs = H2O.STORE.raw_array();
// Start the walk at slot 2, because slots 0,1 hold meta-data
for( int i=2; i<kvs.length; i += 2 ) {
// In the raw backing array, Keys and Values alternate in slots
Object ov = kvs[i+1];
... | java | public static String STOREtoString() {
int[] cnts = new int[1];
Object[] kvs = H2O.STORE.raw_array();
// Start the walk at slot 2, because slots 0,1 hold meta-data
for( int i=2; i<kvs.length; i += 2 ) {
// In the raw backing array, Keys and Values alternate in slots
Object ov = kvs[i+1];
... | [
"public",
"static",
"String",
"STOREtoString",
"(",
")",
"{",
"int",
"[",
"]",
"cnts",
"=",
"new",
"int",
"[",
"1",
"]",
";",
"Object",
"[",
"]",
"kvs",
"=",
"H2O",
".",
"STORE",
".",
"raw_array",
"(",
")",
";",
"// Start the walk at slot 2, because slot... | Nice local-STORE only debugging summary | [
"Nice",
"local",
"-",
"STORE",
"only",
"debugging",
"summary"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1911-L1930 |
131,052 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.checkUnsupportedJava | public static boolean checkUnsupportedJava() {
if (Boolean.getBoolean(H2O.OptArgs.SYSTEM_PROP_PREFIX + "debug.noJavaVersionCheck")) {
return false;
}
// Notes:
// - make sure that the following whitelist is logically consistent with whitelist in R code - see function .h2o.check_java_version in c... | java | public static boolean checkUnsupportedJava() {
if (Boolean.getBoolean(H2O.OptArgs.SYSTEM_PROP_PREFIX + "debug.noJavaVersionCheck")) {
return false;
}
// Notes:
// - make sure that the following whitelist is logically consistent with whitelist in R code - see function .h2o.check_java_version in c... | [
"public",
"static",
"boolean",
"checkUnsupportedJava",
"(",
")",
"{",
"if",
"(",
"Boolean",
".",
"getBoolean",
"(",
"H2O",
".",
"OptArgs",
".",
"SYSTEM_PROP_PREFIX",
"+",
"\"debug.noJavaVersionCheck\"",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Notes: ",
... | Check if the Java version is not supported
@return true if not supported | [
"Check",
"if",
"the",
"Java",
"version",
"is",
"not",
"supported"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L1968-L1986 |
131,053 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.getCurrentPID | private static long getCurrentPID() {
try {
String n = ManagementFactory.getRuntimeMXBean().getName();
int i = n.indexOf('@');
if(i != -1) {
return Long.parseLong(n.substring(0, i));
} else {
return -1L;
}
} catch(Throwable ignore) {
return -1L;
}
} | java | private static long getCurrentPID() {
try {
String n = ManagementFactory.getRuntimeMXBean().getName();
int i = n.indexOf('@');
if(i != -1) {
return Long.parseLong(n.substring(0, i));
} else {
return -1L;
}
} catch(Throwable ignore) {
return -1L;
}
} | [
"private",
"static",
"long",
"getCurrentPID",
"(",
")",
"{",
"try",
"{",
"String",
"n",
"=",
"ManagementFactory",
".",
"getRuntimeMXBean",
"(",
")",
".",
"getName",
"(",
")",
";",
"int",
"i",
"=",
"n",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
... | Find PID of the current process, use -1 if we can't find the value. | [
"Find",
"PID",
"of",
"the",
"current",
"process",
"use",
"-",
"1",
"if",
"we",
"can",
"t",
"find",
"the",
"value",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L2185-L2197 |
131,054 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2O.java | H2O.setFlatfile | public static void setFlatfile(Set<H2ONode> nodes) {
if (nodes == null) {
STATIC_H2OS = null;
} else {
STATIC_H2OS = Collections.newSetFromMap(new ConcurrentHashMap<H2ONode, Boolean>());
STATIC_H2OS.addAll(nodes);
}
} | java | public static void setFlatfile(Set<H2ONode> nodes) {
if (nodes == null) {
STATIC_H2OS = null;
} else {
STATIC_H2OS = Collections.newSetFromMap(new ConcurrentHashMap<H2ONode, Boolean>());
STATIC_H2OS.addAll(nodes);
}
} | [
"public",
"static",
"void",
"setFlatfile",
"(",
"Set",
"<",
"H2ONode",
">",
"nodes",
")",
"{",
"if",
"(",
"nodes",
"==",
"null",
")",
"{",
"STATIC_H2OS",
"=",
"null",
";",
"}",
"else",
"{",
"STATIC_H2OS",
"=",
"Collections",
".",
"newSetFromMap",
"(",
... | Setup a set of nodes which should be contacted during manual multicast
@param nodes set of H2O nodes | [
"Setup",
"a",
"set",
"of",
"nodes",
"which",
"should",
"be",
"contacted",
"during",
"manual",
"multicast"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2O.java#L2255-L2262 |
131,055 | h2oai/h2o-3 | h2o-core/src/main/java/water/TaskPutKey.java | TaskPutKey.onAck | @Override public void onAck() {
// remove local cache but NOT in case it is already on disk
// (ie memory can be reclaimed and we assume we have plenty of disk space)
if( _dontCache && !_xval.isPersisted() ) H2O.putIfMatch(_xkey, null, _xval);
if( _xval != null ) _xval.completeRemotePut();
} | java | @Override public void onAck() {
// remove local cache but NOT in case it is already on disk
// (ie memory can be reclaimed and we assume we have plenty of disk space)
if( _dontCache && !_xval.isPersisted() ) H2O.putIfMatch(_xkey, null, _xval);
if( _xval != null ) _xval.completeRemotePut();
} | [
"@",
"Override",
"public",
"void",
"onAck",
"(",
")",
"{",
"// remove local cache but NOT in case it is already on disk",
"// (ie memory can be reclaimed and we assume we have plenty of disk space)",
"if",
"(",
"_dontCache",
"&&",
"!",
"_xval",
".",
"isPersisted",
"(",
")",
"... | Received an ACK | [
"Received",
"an",
"ACK"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/TaskPutKey.java#L50-L55 |
131,056 | h2oai/h2o-3 | h2o-core/src/main/java/water/util/PrettyPrint.java | PrettyPrint.UUID | public static String UUID( long lo, long hi ) {
long lo0 = (lo>>32)&0xFFFFFFFFL;
long lo1 = (lo>>16)&0xFFFFL;
long lo2 = (lo>> 0)&0xFFFFL;
long hi0 = (hi>>48)&0xFFFFL;
long hi1 = (hi>> 0)&0xFFFFFFFFFFFFL;
return String.format("%08X-%04X-%04X-%04X-%012X",lo0,lo1,lo2,hi0,hi1);
} | java | public static String UUID( long lo, long hi ) {
long lo0 = (lo>>32)&0xFFFFFFFFL;
long lo1 = (lo>>16)&0xFFFFL;
long lo2 = (lo>> 0)&0xFFFFL;
long hi0 = (hi>>48)&0xFFFFL;
long hi1 = (hi>> 0)&0xFFFFFFFFFFFFL;
return String.format("%08X-%04X-%04X-%04X-%012X",lo0,lo1,lo2,hi0,hi1);
} | [
"public",
"static",
"String",
"UUID",
"(",
"long",
"lo",
",",
"long",
"hi",
")",
"{",
"long",
"lo0",
"=",
"(",
"lo",
">>",
"32",
")",
"&",
"0xFFFFFFFF",
"L",
";",
"long",
"lo1",
"=",
"(",
"lo",
">>",
"16",
")",
"&",
"0xFFFF",
"L",
";",
"long",
... | About as clumsy and random as a blaster... | [
"About",
"as",
"clumsy",
"and",
"random",
"as",
"a",
"blaster",
"..."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/PrettyPrint.java#L135-L142 |
131,057 | h2oai/h2o-3 | h2o-core/src/main/java/water/KeySnapshot.java | KeySnapshot.filter | public KeySnapshot filter(KVFilter kvf){
ArrayList<KeyInfo> res = new ArrayList<>();
for(KeyInfo kinfo: _keyInfos)
if(kvf.filter(kinfo))res.add(kinfo);
return new KeySnapshot(res.toArray(new KeyInfo[res.size()]));
} | java | public KeySnapshot filter(KVFilter kvf){
ArrayList<KeyInfo> res = new ArrayList<>();
for(KeyInfo kinfo: _keyInfos)
if(kvf.filter(kinfo))res.add(kinfo);
return new KeySnapshot(res.toArray(new KeyInfo[res.size()]));
} | [
"public",
"KeySnapshot",
"filter",
"(",
"KVFilter",
"kvf",
")",
"{",
"ArrayList",
"<",
"KeyInfo",
">",
"res",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"KeyInfo",
"kinfo",
":",
"_keyInfos",
")",
"if",
"(",
"kvf",
".",
"filter",
"(",
"... | Filter the snapshot providing custom filter.
Only the keys for which filter returns true will be present in the new snapshot.
@param kvf The filter
@return filtered snapshot | [
"Filter",
"the",
"snapshot",
"providing",
"custom",
"filter",
".",
"Only",
"the",
"keys",
"for",
"which",
"filter",
"returns",
"true",
"will",
"be",
"present",
"in",
"the",
"new",
"snapshot",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/KeySnapshot.java#L62-L67 |
131,058 | h2oai/h2o-3 | h2o-core/src/main/java/water/KeySnapshot.java | KeySnapshot.globalKeysOfClass | public static Key[] globalKeysOfClass(final Class clz) {
return KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() {
@Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k._type, clz); }
}).keys();
} | java | public static Key[] globalKeysOfClass(final Class clz) {
return KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() {
@Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k._type, clz); }
}).keys();
} | [
"public",
"static",
"Key",
"[",
"]",
"globalKeysOfClass",
"(",
"final",
"Class",
"clz",
")",
"{",
"return",
"KeySnapshot",
".",
"globalSnapshot",
"(",
")",
".",
"filter",
"(",
"new",
"KeySnapshot",
".",
"KVFilter",
"(",
")",
"{",
"@",
"Override",
"public",... | Return all the keys of the given class.
@param clz Class
@return array of keys in this snapshot with the given class | [
"Return",
"all",
"the",
"keys",
"of",
"the",
"given",
"class",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/KeySnapshot.java#L86-L90 |
131,059 | h2oai/h2o-3 | h2o-core/src/main/java/water/KeySnapshot.java | KeySnapshot.localSnapshot | public static KeySnapshot localSnapshot(boolean homeOnly){
Object [] kvs = H2O.STORE.raw_array();
ArrayList<KeyInfo> res = new ArrayList<>();
for(int i = 2; i < kvs.length; i+= 2){
Object ok = kvs[i];
if( !(ok instanceof Key ) ) continue; // Ignore tombstones and Primes and null's
Key key... | java | public static KeySnapshot localSnapshot(boolean homeOnly){
Object [] kvs = H2O.STORE.raw_array();
ArrayList<KeyInfo> res = new ArrayList<>();
for(int i = 2; i < kvs.length; i+= 2){
Object ok = kvs[i];
if( !(ok instanceof Key ) ) continue; // Ignore tombstones and Primes and null's
Key key... | [
"public",
"static",
"KeySnapshot",
"localSnapshot",
"(",
"boolean",
"homeOnly",
")",
"{",
"Object",
"[",
"]",
"kvs",
"=",
"H2O",
".",
"STORE",
".",
"raw_array",
"(",
")",
";",
"ArrayList",
"<",
"KeyInfo",
">",
"res",
"=",
"new",
"ArrayList",
"<>",
"(",
... | Get the user keys from this node only.
@param homeOnly - exclude the non-local (cached) keys if set
@return KeySnapshot containing keys from the local K/V. | [
"Get",
"the",
"user",
"keys",
"from",
"this",
"node",
"only",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/KeySnapshot.java#L140-L161 |
131,060 | h2oai/h2o-3 | h2o-core/src/main/java/water/KeySnapshot.java | KeySnapshot.globalSnapshot | public static KeySnapshot globalSnapshot(long timeTolerance){
KeySnapshot res = _cache;
final long t = System.currentTimeMillis();
if(res == null || (t - res.timestamp) > timeTolerance)
res = new KeySnapshot((new GlobalUKeySetTask().doAllNodes()._res));
else if(t - res.timestamp > _updateInterval)... | java | public static KeySnapshot globalSnapshot(long timeTolerance){
KeySnapshot res = _cache;
final long t = System.currentTimeMillis();
if(res == null || (t - res.timestamp) > timeTolerance)
res = new KeySnapshot((new GlobalUKeySetTask().doAllNodes()._res));
else if(t - res.timestamp > _updateInterval)... | [
"public",
"static",
"KeySnapshot",
"globalSnapshot",
"(",
"long",
"timeTolerance",
")",
"{",
"KeySnapshot",
"res",
"=",
"_cache",
";",
"final",
"long",
"t",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"res",
"==",
"null",
"||",
"(",
... | Cache-enabled call to get global key snapshot.
User can provide time tolerance to indicate a how old the snapshot can be.
@param timeTolerance - tolerated age of the cache in millis.
If the last snapshot is bellow this value, cached version will be returned immediately.
Otherwise new snapshot must be obtained by from a... | [
"Cache",
"-",
"enabled",
"call",
"to",
"get",
"global",
"key",
"snapshot",
".",
"User",
"can",
"provide",
"time",
"tolerance",
"to",
"indicate",
"a",
"how",
"old",
"the",
"snapshot",
"can",
"be",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/KeySnapshot.java#L174-L187 |
131,061 | h2oai/h2o-3 | h2o-core/src/main/java/water/H2OStarter.java | H2OStarter.start | public static void start(String[] args, String relativeResourcePath, boolean finalizeRestRegistration) {
long time0 = System.currentTimeMillis();
// Fire up the H2O Cluster
H2O.main(args);
H2O.registerResourceRoot(new File(relativeResourcePath + File.separator + "h2o-web/src/main/resources/www"));
... | java | public static void start(String[] args, String relativeResourcePath, boolean finalizeRestRegistration) {
long time0 = System.currentTimeMillis();
// Fire up the H2O Cluster
H2O.main(args);
H2O.registerResourceRoot(new File(relativeResourcePath + File.separator + "h2o-web/src/main/resources/www"));
... | [
"public",
"static",
"void",
"start",
"(",
"String",
"[",
"]",
"args",
",",
"String",
"relativeResourcePath",
",",
"boolean",
"finalizeRestRegistration",
")",
"{",
"long",
"time0",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"// Fire up the H2O Cluster"... | Start H2O node.
@param args H2O parameters
@param relativeResourcePath FIXME remove it
@param finalizeRestRegistration close registration of REST API | [
"Start",
"H2O",
"node",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/H2OStarter.java#L19-L40 |
131,062 | h2oai/h2o-3 | h2o-core/src/main/java/water/Iced.java | Iced.icer | private Icer<D> icer() {
int id = _ice_id;
int tyid;
if(id != 0) assert id == (tyid =TypeMap.onIce(this)):"incorrectly cashed id " + id + ", typemap has " + tyid + ", type = " + getClass().getName();
return TypeMap.getIcer(id!=0 ? id : (_ice_id=(short)TypeMap.onIce(this)),this);
} | java | private Icer<D> icer() {
int id = _ice_id;
int tyid;
if(id != 0) assert id == (tyid =TypeMap.onIce(this)):"incorrectly cashed id " + id + ", typemap has " + tyid + ", type = " + getClass().getName();
return TypeMap.getIcer(id!=0 ? id : (_ice_id=(short)TypeMap.onIce(this)),this);
} | [
"private",
"Icer",
"<",
"D",
">",
"icer",
"(",
")",
"{",
"int",
"id",
"=",
"_ice_id",
";",
"int",
"tyid",
";",
"if",
"(",
"id",
"!=",
"0",
")",
"assert",
"id",
"==",
"(",
"tyid",
"=",
"TypeMap",
".",
"onIce",
"(",
"this",
")",
")",
":",
"\"in... | Return the icer for this instance+class. Will set on 1st use. | [
"Return",
"the",
"icer",
"for",
"this",
"instance",
"+",
"class",
".",
"Will",
"set",
"on",
"1st",
"use",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Iced.java#L51-L56 |
131,063 | h2oai/h2o-3 | h2o-core/src/main/java/water/Iced.java | Iced.readExternal | @Override public void readExternal( ObjectInput ois ) throws IOException, ClassNotFoundException {
int x = ois.readInt();
byte[] buf = MemoryManager.malloc1(x);
ois.readFully(buf);
read(new AutoBuffer(buf));
} | java | @Override public void readExternal( ObjectInput ois ) throws IOException, ClassNotFoundException {
int x = ois.readInt();
byte[] buf = MemoryManager.malloc1(x);
ois.readFully(buf);
read(new AutoBuffer(buf));
} | [
"@",
"Override",
"public",
"void",
"readExternal",
"(",
"ObjectInput",
"ois",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"int",
"x",
"=",
"ois",
".",
"readInt",
"(",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"MemoryManager",
".",
"mall... | Java serializers use H2Os Icing | [
"Java",
"serializers",
"use",
"H2Os",
"Icing"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/Iced.java#L119-L124 |
131,064 | h2oai/h2o-3 | h2o-core/src/main/java/water/jdbc/SQLManager.java | SQLManager.buildSelectSingleRowSql | static String buildSelectSingleRowSql(String databaseType, String table, String columns) {
switch(databaseType) {
case SQL_SERVER_DB_TYPE: //syntax supported since SQLServer 2008
return "SELECT TOP(1) " + columns + " FROM " + table;
case ORACLE_DB_TYPE:
return "SELECT " + columns + " F... | java | static String buildSelectSingleRowSql(String databaseType, String table, String columns) {
switch(databaseType) {
case SQL_SERVER_DB_TYPE: //syntax supported since SQLServer 2008
return "SELECT TOP(1) " + columns + " FROM " + table;
case ORACLE_DB_TYPE:
return "SELECT " + columns + " F... | [
"static",
"String",
"buildSelectSingleRowSql",
"(",
"String",
"databaseType",
",",
"String",
"table",
",",
"String",
"columns",
")",
"{",
"switch",
"(",
"databaseType",
")",
"{",
"case",
"SQL_SERVER_DB_TYPE",
":",
"//syntax supported since SQLServer 2008",
"return",
"... | Builds SQL SELECT to retrieve single row from a table based on type of database
@param databaseType
@param table
@param columns
@return String SQL SELECT statement | [
"Builds",
"SQL",
"SELECT",
"to",
"retrieve",
"single",
"row",
"from",
"a",
"table",
"based",
"on",
"type",
"of",
"database"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/jdbc/SQLManager.java#L308-L323 |
131,065 | h2oai/h2o-3 | h2o-core/src/main/java/water/jdbc/SQLManager.java | SQLManager.buildSelectChunkSql | static String buildSelectChunkSql(String databaseType, String table, long start, int length, String columns, String[] columnNames) {
String sqlText = "SELECT " + columns + " FROM " + table;
switch(databaseType) {
case SQL_SERVER_DB_TYPE: // requires ORDER BY clause with OFFSET/FETCH NEXT clauses, syntax... | java | static String buildSelectChunkSql(String databaseType, String table, long start, int length, String columns, String[] columnNames) {
String sqlText = "SELECT " + columns + " FROM " + table;
switch(databaseType) {
case SQL_SERVER_DB_TYPE: // requires ORDER BY clause with OFFSET/FETCH NEXT clauses, syntax... | [
"static",
"String",
"buildSelectChunkSql",
"(",
"String",
"databaseType",
",",
"String",
"table",
",",
"long",
"start",
",",
"int",
"length",
",",
"String",
"columns",
",",
"String",
"[",
"]",
"columnNames",
")",
"{",
"String",
"sqlText",
"=",
"\"SELECT \"",
... | Builds SQL SELECT to retrieve chunk of rows from a table based on row offset and number of rows in a chunk.
Pagination in following Databases:
SQL Server, Oracle 12c: OFFSET x ROWS FETCH NEXT y ROWS ONLY
SQL Server, Vertica may need ORDER BY
MySQL, PostgreSQL, MariaDB: LIMIT y OFFSET x
Teradata (and possibly older O... | [
"Builds",
"SQL",
"SELECT",
"to",
"retrieve",
"chunk",
"of",
"rows",
"from",
"a",
"table",
"based",
"on",
"row",
"offset",
"and",
"number",
"of",
"rows",
"in",
"a",
"chunk",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/jdbc/SQLManager.java#L346-L368 |
131,066 | h2oai/h2o-3 | h2o-core/src/main/java/water/jdbc/SQLManager.java | SQLManager.initializeDatabaseDriver | static void initializeDatabaseDriver(String databaseType) {
String driverClass = System.getProperty(JDBC_DRIVER_CLASS_KEY_PREFIX + databaseType);
if (driverClass != null) {
Log.debug("Loading " + driverClass + " to initialize database of type " + databaseType);
try {
Class.forName(driverClas... | java | static void initializeDatabaseDriver(String databaseType) {
String driverClass = System.getProperty(JDBC_DRIVER_CLASS_KEY_PREFIX + databaseType);
if (driverClass != null) {
Log.debug("Loading " + driverClass + " to initialize database of type " + databaseType);
try {
Class.forName(driverClas... | [
"static",
"void",
"initializeDatabaseDriver",
"(",
"String",
"databaseType",
")",
"{",
"String",
"driverClass",
"=",
"System",
".",
"getProperty",
"(",
"JDBC_DRIVER_CLASS_KEY_PREFIX",
"+",
"databaseType",
")",
";",
"if",
"(",
"driverClass",
"!=",
"null",
")",
"{",... | Initializes database driver for databases with JDBC driver version lower than 4.0
@param databaseType Name of target database from JDBC connection string | [
"Initializes",
"database",
"driver",
"for",
"databases",
"with",
"JDBC",
"driver",
"version",
"lower",
"than",
"4",
".",
"0"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/jdbc/SQLManager.java#L497-L528 |
131,067 | h2oai/h2o-3 | h2o-core/src/main/java/water/parser/ParserService.java | ParserService.getAllProviders | synchronized public List<ParserProvider> getAllProviders(boolean sort) {
List<ParserProvider> providers = new ArrayList<>();
for(ParserProvider pp : loader) {
providers.add(pp);
}
if (sort) {
Collections.sort(providers, PARSER_PROVIDER_COMPARATOR);
}
return providers;
} | java | synchronized public List<ParserProvider> getAllProviders(boolean sort) {
List<ParserProvider> providers = new ArrayList<>();
for(ParserProvider pp : loader) {
providers.add(pp);
}
if (sort) {
Collections.sort(providers, PARSER_PROVIDER_COMPARATOR);
}
return providers;
} | [
"synchronized",
"public",
"List",
"<",
"ParserProvider",
">",
"getAllProviders",
"(",
"boolean",
"sort",
")",
"{",
"List",
"<",
"ParserProvider",
">",
"providers",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"ParserProvider",
"pp",
":",
"loader... | Returns all parser providers sorted based on priority if required.
@param sort
@return | [
"Returns",
"all",
"parser",
"providers",
"sorted",
"based",
"on",
"priority",
"if",
"required",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/parser/ParserService.java#L39-L48 |
131,068 | h2oai/h2o-3 | h2o-core/src/main/java/water/util/OSUtils.java | OSUtils.getTotalPhysicalMemory | public static long getTotalPhysicalMemory() {
long memory = -1;
try {
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
Object attribute = mBeanServer.getAttribute(new ObjectName("java.lang","type","OperatingSystem"), "TotalPhysicalMemorySize");
return (Long) attribute;
} cat... | java | public static long getTotalPhysicalMemory() {
long memory = -1;
try {
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
Object attribute = mBeanServer.getAttribute(new ObjectName("java.lang","type","OperatingSystem"), "TotalPhysicalMemorySize");
return (Long) attribute;
} cat... | [
"public",
"static",
"long",
"getTotalPhysicalMemory",
"(",
")",
"{",
"long",
"memory",
"=",
"-",
"1",
";",
"try",
"{",
"MBeanServer",
"mBeanServer",
"=",
"ManagementFactory",
".",
"getPlatformMBeanServer",
"(",
")",
";",
"Object",
"attribute",
"=",
"mBeanServer"... | Safe call to obtain size of total physical memory.
<p>It is platform dependent and returns size of machine physical
memory in bytes</p>
@return total size of machine physical memory in bytes or -1 if the attribute is not available. | [
"Safe",
"call",
"to",
"obtain",
"size",
"of",
"total",
"physical",
"memory",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/OSUtils.java#L17-L25 |
131,069 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/ast/prims/mungers/AstApply.java | AstApply.rowwise | private ValFrame rowwise(Env env, Frame fr, final AstPrimitive fun) {
final String[] names = fr._names;
final AstFunction scope = env._scope; // Current execution scope; needed to lookup variables
// do a single row of the frame to determine the size of the output.
double[] ds = new double[fr.numCols... | java | private ValFrame rowwise(Env env, Frame fr, final AstPrimitive fun) {
final String[] names = fr._names;
final AstFunction scope = env._scope; // Current execution scope; needed to lookup variables
// do a single row of the frame to determine the size of the output.
double[] ds = new double[fr.numCols... | [
"private",
"ValFrame",
"rowwise",
"(",
"Env",
"env",
",",
"Frame",
"fr",
",",
"final",
"AstPrimitive",
"fun",
")",
"{",
"final",
"String",
"[",
"]",
"names",
"=",
"fr",
".",
"_names",
";",
"final",
"AstFunction",
"scope",
"=",
"env",
".",
"_scope",
";"... | 1 argument. All rows are independent, and run in parallel | [
"1",
"argument",
".",
"All",
"rows",
"are",
"independent",
"and",
"run",
"in",
"parallel"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/ast/prims/mungers/AstApply.java#L107-L139 |
131,070 | h2oai/h2o-3 | h2o-core/src/main/java/water/util/IcedHashMapBase.java | IcedHashMapBase.write_impl | public final AutoBuffer write_impl( AutoBuffer ab ) {
_write_lock = true;
try {
if (map().size() == 0) return ab.put1(0); // empty map
Entry<K, V> entry = map().entrySet().iterator().next();
K key = entry.getKey();
V val = entry.getValue();
assert key != null && val != null;
... | java | public final AutoBuffer write_impl( AutoBuffer ab ) {
_write_lock = true;
try {
if (map().size() == 0) return ab.put1(0); // empty map
Entry<K, V> entry = map().entrySet().iterator().next();
K key = entry.getKey();
V val = entry.getValue();
assert key != null && val != null;
... | [
"public",
"final",
"AutoBuffer",
"write_impl",
"(",
"AutoBuffer",
"ab",
")",
"{",
"_write_lock",
"=",
"true",
";",
"try",
"{",
"if",
"(",
"map",
"(",
")",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"ab",
".",
"put1",
"(",
"0",
")",
";",
"//... | random Value is written. | [
"random",
"Value",
"is",
"written",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/IcedHashMapBase.java#L46-L81 |
131,071 | h2oai/h2o-3 | h2o-core/src/main/java/hex/quantile/Quantile.java | Quantile.computeQuantile | static double computeQuantile( double lo, double hi, double row, double nrows, double prob, QuantileModel.CombineMethod method ) {
if( lo==hi ) return lo; // Equal; pick either
if( method == null ) method= QuantileModel.CombineMethod.INTERPOLATE;
switch( method ) {
case INTERPOLATE: return linearInt... | java | static double computeQuantile( double lo, double hi, double row, double nrows, double prob, QuantileModel.CombineMethod method ) {
if( lo==hi ) return lo; // Equal; pick either
if( method == null ) method= QuantileModel.CombineMethod.INTERPOLATE;
switch( method ) {
case INTERPOLATE: return linearInt... | [
"static",
"double",
"computeQuantile",
"(",
"double",
"lo",
",",
"double",
"hi",
",",
"double",
"row",
",",
"double",
"nrows",
",",
"double",
"prob",
",",
"QuantileModel",
".",
"CombineMethod",
"method",
")",
"{",
"if",
"(",
"lo",
"==",
"hi",
")",
"retur... | Compute the correct final quantile from these 4 values. If the lo and hi
elements are equal, use them. However if they differ, then there is no
single value which exactly matches the desired quantile. There are
several well-accepted definitions in this case - including picking either
the lo or the hi, or averaging t... | [
"Compute",
"the",
"correct",
"final",
"quantile",
"from",
"these",
"4",
"values",
".",
"If",
"the",
"lo",
"and",
"hi",
"elements",
"are",
"equal",
"use",
"them",
".",
"However",
"if",
"they",
"differ",
"then",
"there",
"is",
"no",
"single",
"value",
"whi... | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/quantile/Quantile.java#L330-L342 |
131,072 | h2oai/h2o-3 | h2o-mapreduce-generic/src/main/java/water/hadoop/H2OYarnDiagnostic.java | H2OYarnDiagnostic.diagnose | public static void diagnose(String applicationId, String queueName, int numNodes, int nodeMemoryMb, int numNodesStarted) throws Exception {
H2OYarnDiagnostic client = new H2OYarnDiagnostic();
client.applicationId = applicationId;
client.queueName = queueName;
client.numNodes = numNodes;
... | java | public static void diagnose(String applicationId, String queueName, int numNodes, int nodeMemoryMb, int numNodesStarted) throws Exception {
H2OYarnDiagnostic client = new H2OYarnDiagnostic();
client.applicationId = applicationId;
client.queueName = queueName;
client.numNodes = numNodes;
... | [
"public",
"static",
"void",
"diagnose",
"(",
"String",
"applicationId",
",",
"String",
"queueName",
",",
"int",
"numNodes",
",",
"int",
"nodeMemoryMb",
",",
"int",
"numNodesStarted",
")",
"throws",
"Exception",
"{",
"H2OYarnDiagnostic",
"client",
"=",
"new",
"H2... | The assumption is this method doesn't get called unless a problem occurred.
@param queueName YARN queue name
@param numNodes Requested number of worker containers (not including AM)
@param nodeMemoryMb Requested worker container size
@param numNodesStarted Number of containers that actually got started before giving u... | [
"The",
"assumption",
"is",
"this",
"method",
"doesn",
"t",
"get",
"called",
"unless",
"a",
"problem",
"occurred",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-mapreduce-generic/src/main/java/water/hadoop/H2OYarnDiagnostic.java#L54-L63 |
131,073 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/ast/prims/string/AstCountSubstringsWords.java | AstCountSubstringsWords.calcCountSubstringsWords | private int calcCountSubstringsWords(String str, HashSet<String> words) {
int wordCount = 0;
int N = str.length();
for (int i = 0; i < N - 1; i++)
for (int j = i + 2; j < N + 1; j++) {
if (words.contains(str.substring(i, j)))
wordCount += 1;
}
return wordCount;
} | java | private int calcCountSubstringsWords(String str, HashSet<String> words) {
int wordCount = 0;
int N = str.length();
for (int i = 0; i < N - 1; i++)
for (int j = i + 2; j < N + 1; j++) {
if (words.contains(str.substring(i, j)))
wordCount += 1;
}
return wordCount;
} | [
"private",
"int",
"calcCountSubstringsWords",
"(",
"String",
"str",
",",
"HashSet",
"<",
"String",
">",
"words",
")",
"{",
"int",
"wordCount",
"=",
"0",
";",
"int",
"N",
"=",
"str",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | count all substrings >= 2 chars that are in words | [
"count",
"all",
"substrings",
">",
"=",
"2",
"chars",
"that",
"are",
"in",
"words"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/ast/prims/string/AstCountSubstringsWords.java#L113-L122 |
131,074 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/ast/prims/operators/AstNe.java | AstNe.str_op | public double str_op(BufferedString l, BufferedString r) {
if (StringUtils.isNullOrEmpty(l))
return StringUtils.isNullOrEmpty(r) ? 0 : 1;
else
return l.equals(r) ? 0 : 1;
} | java | public double str_op(BufferedString l, BufferedString r) {
if (StringUtils.isNullOrEmpty(l))
return StringUtils.isNullOrEmpty(r) ? 0 : 1;
else
return l.equals(r) ? 0 : 1;
} | [
"public",
"double",
"str_op",
"(",
"BufferedString",
"l",
",",
"BufferedString",
"r",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"l",
")",
")",
"return",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"r",
")",
"?",
"0",
":",
"1",
";",
"... | Make sense to run this OP on an enm? | [
"Make",
"sense",
"to",
"run",
"this",
"OP",
"on",
"an",
"enm?"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/ast/prims/operators/AstNe.java#L50-L55 |
131,075 | h2oai/h2o-3 | h2o-core/src/main/java/water/parser/ParserProvider.java | ParserProvider.guessInitSetup | public ParseSetup guessInitSetup(ByteVec v, byte[] bits, ParseSetup userSetup) {
return guessSetup(v, bits, userSetup._separator, userSetup._number_columns, userSetup._single_quotes,
userSetup._check_header, userSetup._column_names, userSetup._column_types, userSetup._domains, userSetup._na_strings);
... | java | public ParseSetup guessInitSetup(ByteVec v, byte[] bits, ParseSetup userSetup) {
return guessSetup(v, bits, userSetup._separator, userSetup._number_columns, userSetup._single_quotes,
userSetup._check_header, userSetup._column_names, userSetup._column_types, userSetup._domains, userSetup._na_strings);
... | [
"public",
"ParseSetup",
"guessInitSetup",
"(",
"ByteVec",
"v",
",",
"byte",
"[",
"]",
"bits",
",",
"ParseSetup",
"userSetup",
")",
"{",
"return",
"guessSetup",
"(",
"v",
",",
"bits",
",",
"userSetup",
".",
"_separator",
",",
"userSetup",
".",
"_number_column... | Constructs initial ParseSetup from a given user setup
Any exception thrown by this method will signal that this ParserProvider doesn't support
the input data.
Parsers of data formats that provide metadata (eg. a binary file formats like Parquet) should use the
file metadata to identify the parse type and possibly oth... | [
"Constructs",
"initial",
"ParseSetup",
"from",
"a",
"given",
"user",
"setup"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/parser/ParserProvider.java#L63-L66 |
131,076 | h2oai/h2o-3 | h2o-core/src/main/java/water/parser/ParserProvider.java | ParserProvider.guessSetup | public ParseSetup guessSetup(ByteVec v, byte[] bits, byte sep, int ncols, boolean singleQuotes, int checkHeader, String[] columnNames, byte[] columnTypes, String[][] domains, String[][] naStrings) {
throw new UnsupportedOperationException("Not implemented. This method is kept only for backwards compatibility. " +
... | java | public ParseSetup guessSetup(ByteVec v, byte[] bits, byte sep, int ncols, boolean singleQuotes, int checkHeader, String[] columnNames, byte[] columnTypes, String[][] domains, String[][] naStrings) {
throw new UnsupportedOperationException("Not implemented. This method is kept only for backwards compatibility. " +
... | [
"public",
"ParseSetup",
"guessSetup",
"(",
"ByteVec",
"v",
",",
"byte",
"[",
"]",
"bits",
",",
"byte",
"sep",
",",
"int",
"ncols",
",",
"boolean",
"singleQuotes",
",",
"int",
"checkHeader",
",",
"String",
"[",
"]",
"columnNames",
",",
"byte",
"[",
"]",
... | Returns parser setup of throws exception if input is not recognized | [
"Returns",
"parser",
"setup",
"of",
"throws",
"exception",
"if",
"input",
"is",
"not",
"recognized"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/parser/ParserProvider.java#L81-L84 |
131,077 | h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/tools/MungeCsv.java | MungeCsv.parseDataRow | private static RowData parseDataRow(String line, GenMunger munger) {
if( line.isEmpty() || line.equals("") )
return null;
String[] inputData = line.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)|(,)", -1);
for(int i=0;i<inputData.length;++i)
inputData[i]=inputData[i]==null?"":inputData[i];
... | java | private static RowData parseDataRow(String line, GenMunger munger) {
if( line.isEmpty() || line.equals("") )
return null;
String[] inputData = line.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)|(,)", -1);
for(int i=0;i<inputData.length;++i)
inputData[i]=inputData[i]==null?"":inputData[i];
... | [
"private",
"static",
"RowData",
"parseDataRow",
"(",
"String",
"line",
",",
"GenMunger",
"munger",
")",
"{",
"if",
"(",
"line",
".",
"isEmpty",
"(",
")",
"||",
"line",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
"null",
";",
"String",
"[",
"]",
"... | This CSV parser is as bare bones as it gets.
Our test data doesn't have funny quoting, spacing, or other issues.
Can't handle cases where the number of data columns is less than the number of header columns. | [
"This",
"CSV",
"parser",
"is",
"as",
"bare",
"bones",
"as",
"it",
"gets",
".",
"Our",
"test",
"data",
"doesn",
"t",
"have",
"funny",
"quoting",
"spacing",
"or",
"other",
"issues",
".",
"Can",
"t",
"handle",
"cases",
"where",
"the",
"number",
"of",
"dat... | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/tools/MungeCsv.java#L92-L101 |
131,078 | h2oai/h2o-3 | h2o-genmodel/src/main/java/hex/genmodel/tools/MungeCsv.java | MungeCsv.main | public static void main(String[] args) throws Exception {
parseArgs(args);
GenMunger rawMunger;
rawMunger = (hex.genmodel.GenMunger) Class.forName(assemblyClassName).newInstance();
BufferedReader input = new BufferedReader(new FileReader(inputCSVFileName));
BufferedWriter output = new BufferedWrit... | java | public static void main(String[] args) throws Exception {
parseArgs(args);
GenMunger rawMunger;
rawMunger = (hex.genmodel.GenMunger) Class.forName(assemblyClassName).newInstance();
BufferedReader input = new BufferedReader(new FileReader(inputCSVFileName));
BufferedWriter output = new BufferedWrit... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"parseArgs",
"(",
"args",
")",
";",
"GenMunger",
"rawMunger",
";",
"rawMunger",
"=",
"(",
"hex",
".",
"genmodel",
".",
"GenMunger",
")",
"Class",
".",
... | CSV reader and predictor test program.
@param args Command-line args.
@throws Exception | [
"CSV",
"reader",
"and",
"predictor",
"test",
"program",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-genmodel/src/main/java/hex/genmodel/tools/MungeCsv.java#L109-L174 |
131,079 | h2oai/h2o-3 | h2o-core/src/main/java/hex/schemas/HyperSpaceSearchCriteriaV99.java | HyperSpaceSearchCriteriaV99.fillWithDefaults | public S fillWithDefaults() {
HyperSpaceSearchCriteria defaults = null;
if (HyperSpaceSearchCriteria.Strategy.Cartesian == strategy) {
defaults = new HyperSpaceSearchCriteria.CartesianSearchCriteria();
} else if (HyperSpaceSearchCriteria.Strategy.RandomDiscrete == strategy) {
defaults = new Hyp... | java | public S fillWithDefaults() {
HyperSpaceSearchCriteria defaults = null;
if (HyperSpaceSearchCriteria.Strategy.Cartesian == strategy) {
defaults = new HyperSpaceSearchCriteria.CartesianSearchCriteria();
} else if (HyperSpaceSearchCriteria.Strategy.RandomDiscrete == strategy) {
defaults = new Hyp... | [
"public",
"S",
"fillWithDefaults",
"(",
")",
"{",
"HyperSpaceSearchCriteria",
"defaults",
"=",
"null",
";",
"if",
"(",
"HyperSpaceSearchCriteria",
".",
"Strategy",
".",
"Cartesian",
"==",
"strategy",
")",
"{",
"defaults",
"=",
"new",
"HyperSpaceSearchCriteria",
".... | Fill with the default values from the corresponding Iced object. | [
"Fill",
"with",
"the",
"default",
"values",
"from",
"the",
"corresponding",
"Iced",
"object",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/hex/schemas/HyperSpaceSearchCriteriaV99.java#L76-L90 |
131,080 | h2oai/h2o-3 | h2o-core/src/main/java/water/api/AlgoAbstractRegister.java | AlgoAbstractRegister.registerModelBuilder | protected final void registerModelBuilder(RestApiContext context, ModelBuilder mbProto, int version) {
Class<? extends water.api.Handler> handlerClass = water.api.ModelBuilderHandler.class;
if (H2O.ARGS.features_level.compareTo(mbProto.builderVisibility()) > 0) {
return; // Skip endpoint registration
... | java | protected final void registerModelBuilder(RestApiContext context, ModelBuilder mbProto, int version) {
Class<? extends water.api.Handler> handlerClass = water.api.ModelBuilderHandler.class;
if (H2O.ARGS.features_level.compareTo(mbProto.builderVisibility()) > 0) {
return; // Skip endpoint registration
... | [
"protected",
"final",
"void",
"registerModelBuilder",
"(",
"RestApiContext",
"context",
",",
"ModelBuilder",
"mbProto",
",",
"int",
"version",
")",
"{",
"Class",
"<",
"?",
"extends",
"water",
".",
"api",
".",
"Handler",
">",
"handlerClass",
"=",
"water",
".",
... | Register algorithm common REST interface.
@param mbProto prototype instance of algorithm model builder
@param version registration version | [
"Register",
"algorithm",
"common",
"REST",
"interface",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/AlgoAbstractRegister.java#L17-L50 |
131,081 | h2oai/h2o-3 | h2o-persist-http/src/main/java/water/persist/PersistHTTP.java | PersistHTTP.checkRangeSupport | long checkRangeSupport(URI uri) throws IOException {
HttpRequestBase req = createReq(uri, true);
try (CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse response = client.execute(req)) {
Header acceptRangesHeader = response.getFirstHeader(HttpHeaders.ACCEPT_RAN... | java | long checkRangeSupport(URI uri) throws IOException {
HttpRequestBase req = createReq(uri, true);
try (CloseableHttpClient client = HttpClientBuilder.create().build();
CloseableHttpResponse response = client.execute(req)) {
Header acceptRangesHeader = response.getFirstHeader(HttpHeaders.ACCEPT_RAN... | [
"long",
"checkRangeSupport",
"(",
"URI",
"uri",
")",
"throws",
"IOException",
"{",
"HttpRequestBase",
"req",
"=",
"createReq",
"(",
"uri",
",",
"true",
")",
";",
"try",
"(",
"CloseableHttpClient",
"client",
"=",
"HttpClientBuilder",
".",
"create",
"(",
")",
... | Tests whether a given URI can be accessed using range-requests.
@param uri resource identifier
@return -1 if range-requests are not supported, otherwise content length of the requested resource
@throws IOException when communication fails | [
"Tests",
"whether",
"a",
"given",
"URI",
"can",
"be",
"accessed",
"using",
"range",
"-",
"requests",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-persist-http/src/main/java/water/persist/PersistHTTP.java#L106-L119 |
131,082 | h2oai/h2o-3 | h2o-algos/src/main/java/hex/tree/Score.java | Score.getScoringChunks | private Chunk[] getScoringChunks(Chunk[] allChunks) {
if (_preds == null)
return allChunks;
Chunk[] chks = new Chunk[allChunks.length - _preds.numCols()];
System.arraycopy(allChunks, 0, chks, 0, chks.length);
return chks;
} | java | private Chunk[] getScoringChunks(Chunk[] allChunks) {
if (_preds == null)
return allChunks;
Chunk[] chks = new Chunk[allChunks.length - _preds.numCols()];
System.arraycopy(allChunks, 0, chks, 0, chks.length);
return chks;
} | [
"private",
"Chunk",
"[",
"]",
"getScoringChunks",
"(",
"Chunk",
"[",
"]",
"allChunks",
")",
"{",
"if",
"(",
"_preds",
"==",
"null",
")",
"return",
"allChunks",
";",
"Chunk",
"[",
"]",
"chks",
"=",
"new",
"Chunk",
"[",
"allChunks",
".",
"length",
"-",
... | scoring chunks are those chunks that make the input to one of the scoring functions | [
"scoring",
"chunks",
"are",
"those",
"chunks",
"that",
"make",
"the",
"input",
"to",
"one",
"of",
"the",
"scoring",
"functions"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/Score.java#L109-L115 |
131,083 | h2oai/h2o-3 | h2o-algos/src/main/java/hex/tree/Score.java | Score.makeModelMetrics | private ModelMetrics makeModelMetrics(SharedTreeModel model, Frame fr, Frame adaptedFr, Frame preds) {
ModelMetrics mm;
if (model._output.nclasses() == 2 && _computeGainsLift) {
assert preds != null : "Predictions were pre-created";
mm = _mb.makeModelMetrics(model, fr, adaptedFr, preds);
} else ... | java | private ModelMetrics makeModelMetrics(SharedTreeModel model, Frame fr, Frame adaptedFr, Frame preds) {
ModelMetrics mm;
if (model._output.nclasses() == 2 && _computeGainsLift) {
assert preds != null : "Predictions were pre-created";
mm = _mb.makeModelMetrics(model, fr, adaptedFr, preds);
} else ... | [
"private",
"ModelMetrics",
"makeModelMetrics",
"(",
"SharedTreeModel",
"model",
",",
"Frame",
"fr",
",",
"Frame",
"adaptedFr",
",",
"Frame",
"preds",
")",
"{",
"ModelMetrics",
"mm",
";",
"if",
"(",
"model",
".",
"_output",
".",
"nclasses",
"(",
")",
"==",
... | Run after the doAll scoring to convert the MetricsBuilder to a ModelMetrics | [
"Run",
"after",
"the",
"doAll",
"scoring",
"to",
"convert",
"the",
"MetricsBuilder",
"to",
"a",
"ModelMetrics"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/tree/Score.java#L142-L159 |
131,084 | h2oai/h2o-3 | h2o-core/src/main/java/water/ExternalFrameWriterClient.java | ExternalFrameWriterClient.createChunks | public void createChunks(String frameKey, byte[] expectedTypes, int chunkId, int totalNumRows, int[] maxVecSizes) throws IOException {
ab.put1(ExternalFrameHandler.INIT_BYTE);
ab.put1(ExternalFrameHandler.CREATE_FRAME);
ab.putStr(frameKey);
this.expectedTypes = expectedTypes;
ab.... | java | public void createChunks(String frameKey, byte[] expectedTypes, int chunkId, int totalNumRows, int[] maxVecSizes) throws IOException {
ab.put1(ExternalFrameHandler.INIT_BYTE);
ab.put1(ExternalFrameHandler.CREATE_FRAME);
ab.putStr(frameKey);
this.expectedTypes = expectedTypes;
ab.... | [
"public",
"void",
"createChunks",
"(",
"String",
"frameKey",
",",
"byte",
"[",
"]",
"expectedTypes",
",",
"int",
"chunkId",
",",
"int",
"totalNumRows",
",",
"int",
"[",
"]",
"maxVecSizes",
")",
"throws",
"IOException",
"{",
"ab",
".",
"put1",
"(",
"Externa... | Create chunks on the h2o backend. This method creates chunk in en empty frame.
@param frameKey name of the frame
@param expectedTypes expected types
@param chunkId chunk index
@param totalNumRows total number of rows which is about to be sent | [
"Create",
"chunks",
"on",
"the",
"h2o",
"backend",
".",
"This",
"method",
"creates",
"chunk",
"in",
"en",
"empty",
"frame",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExternalFrameWriterClient.java#L76-L86 |
131,085 | h2oai/h2o-3 | h2o-core/src/main/java/water/ExternalFrameWriterClient.java | ExternalFrameWriterClient.waitUntilAllWritten | public void waitUntilAllWritten(int timeout) throws ExternalFrameConfirmationException {
final AutoBuffer confirmAb = new AutoBuffer(channel);
try {
byte flag = ExternalFrameConfirmationCheck.getConfirmation(confirmAb, timeout);
assert (flag == ExternalFrameHandler.CONFIRM_WRITIN... | java | public void waitUntilAllWritten(int timeout) throws ExternalFrameConfirmationException {
final AutoBuffer confirmAb = new AutoBuffer(channel);
try {
byte flag = ExternalFrameConfirmationCheck.getConfirmation(confirmAb, timeout);
assert (flag == ExternalFrameHandler.CONFIRM_WRITIN... | [
"public",
"void",
"waitUntilAllWritten",
"(",
"int",
"timeout",
")",
"throws",
"ExternalFrameConfirmationException",
"{",
"final",
"AutoBuffer",
"confirmAb",
"=",
"new",
"AutoBuffer",
"(",
"channel",
")",
";",
"try",
"{",
"byte",
"flag",
"=",
"ExternalFrameConfirmat... | This method ensures the application waits for all bytes to be written before continuing in the control flow.
It has to be called at the end of writing.
@param timeout timeout in seconds
@throws ExternalFrameConfirmationException | [
"This",
"method",
"ensures",
"the",
"application",
"waits",
"for",
"all",
"bytes",
"to",
"be",
"written",
"before",
"continuing",
"in",
"the",
"control",
"flow",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/ExternalFrameWriterClient.java#L161-L173 |
131,086 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/ast/prims/assign/AstRecAsgnHelper.java | AstRecAsgnHelper.createValueSetter | public static ValueSetter createValueSetter(Vec v, Object value) {
if (value == null) {
return new NAValueSetter();
}
switch (v.get_type()) {
case Vec.T_CAT:
return new CatValueSetter(v.domain(), value);
case Vec.T_NUM:
case Vec.T_TIME:
return new NumValueSetter(value... | java | public static ValueSetter createValueSetter(Vec v, Object value) {
if (value == null) {
return new NAValueSetter();
}
switch (v.get_type()) {
case Vec.T_CAT:
return new CatValueSetter(v.domain(), value);
case Vec.T_NUM:
case Vec.T_TIME:
return new NumValueSetter(value... | [
"public",
"static",
"ValueSetter",
"createValueSetter",
"(",
"Vec",
"v",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"new",
"NAValueSetter",
"(",
")",
";",
"}",
"switch",
"(",
"v",
".",
"get_type",
"(",
")",
... | Create an instance of ValueSetter for a given scalar value.
It creates setter of the appropriate type based on the type of the underlying Vec.
@param v Vec
@param value scalar value
@return instance of ValueSetter | [
"Create",
"an",
"instance",
"of",
"ValueSetter",
"for",
"a",
"given",
"scalar",
"value",
".",
"It",
"creates",
"setter",
"of",
"the",
"appropriate",
"type",
"based",
"on",
"the",
"type",
"of",
"the",
"underlying",
"Vec",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/ast/prims/assign/AstRecAsgnHelper.java#L35-L52 |
131,087 | h2oai/h2o-3 | h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/rabit/util/LinkMap.java | LinkMap.constructRingMap | Map<Integer, Pair<Integer, Integer>> constructRingMap(Map<Integer, List<Integer>> treeMap,
Map<Integer, Integer> parentMap) {
assert parentMap.get(0) == -1;
List<Integer> sharedRing = constructShareRing(treeMap, parentMap, 0);
as... | java | Map<Integer, Pair<Integer, Integer>> constructRingMap(Map<Integer, List<Integer>> treeMap,
Map<Integer, Integer> parentMap) {
assert parentMap.get(0) == -1;
List<Integer> sharedRing = constructShareRing(treeMap, parentMap, 0);
as... | [
"Map",
"<",
"Integer",
",",
"Pair",
"<",
"Integer",
",",
"Integer",
">",
">",
"constructRingMap",
"(",
"Map",
"<",
"Integer",
",",
"List",
"<",
"Integer",
">",
">",
"treeMap",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"parentMap",
")",
"{",
"a... | Returns for each node with "rank" the previous and next node in DFS order. For the root the "previous"
entry will be the last element, which will create a ring type structure. | [
"Returns",
"for",
"each",
"node",
"with",
"rank",
"the",
"previous",
"and",
"next",
"node",
"in",
"DFS",
"order",
".",
"For",
"the",
"root",
"the",
"previous",
"entry",
"will",
"be",
"the",
"last",
"element",
"which",
"will",
"create",
"a",
"ring",
"type... | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/rabit/util/LinkMap.java#L144-L158 |
131,088 | h2oai/h2o-3 | h2o-algos/src/main/java/hex/generic/Generic.java | Generic.getUploadedMojo | private final ByteVec getUploadedMojo(final Key<Frame> key) throws IllegalArgumentException {
Objects.requireNonNull(key); // Nicer null pointer exception in case null key is accidentally provided
Frame mojoFrame = key.get();
if (mojoFrame.numCols() > 1)
throw new IllegalArgumentExc... | java | private final ByteVec getUploadedMojo(final Key<Frame> key) throws IllegalArgumentException {
Objects.requireNonNull(key); // Nicer null pointer exception in case null key is accidentally provided
Frame mojoFrame = key.get();
if (mojoFrame.numCols() > 1)
throw new IllegalArgumentExc... | [
"private",
"final",
"ByteVec",
"getUploadedMojo",
"(",
"final",
"Key",
"<",
"Frame",
">",
"key",
")",
"throws",
"IllegalArgumentException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"key",
")",
";",
"// Nicer null pointer exception in case null key is accidentally provi... | Retrieves pre-uploaded MOJO archive and performs basic verifications, if present.
@param key Key to MOJO bytes in DKV
@return An instance of {@link ByteVec} containing the bytes of an uploaded MOJO, if present. Or exception. Never returns null.
@throws IllegalArgumentException In case the supplied key is invalid (MOJO... | [
"Retrieves",
"pre",
"-",
"uploaded",
"MOJO",
"archive",
"and",
"performs",
"basic",
"verifications",
"if",
"present",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/generic/Generic.java#L89-L101 |
131,089 | h2oai/h2o-3 | h2o-core/src/main/java/water/util/FileUtils.java | FileUtils.closeSilently | public static void closeSilently(Closeable...closeable) {
for(Closeable c : closeable)
try { if( c != null ) c.close(); } catch( IOException xe ) { }
} | java | public static void closeSilently(Closeable...closeable) {
for(Closeable c : closeable)
try { if( c != null ) c.close(); } catch( IOException xe ) { }
} | [
"public",
"static",
"void",
"closeSilently",
"(",
"Closeable",
"...",
"closeable",
")",
"{",
"for",
"(",
"Closeable",
"c",
":",
"closeable",
")",
"try",
"{",
"if",
"(",
"c",
"!=",
"null",
")",
"c",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"I... | Silently close given files.
@param closeable files to close | [
"Silently",
"close",
"given",
"files",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/FileUtils.java#L22-L25 |
131,090 | h2oai/h2o-3 | h2o-core/src/main/java/water/util/FileUtils.java | FileUtils.close | public static void close(Closeable...closeable) {
for(Closeable c : closeable)
try { if( c != null ) c.close(); } catch( IOException ex ) {
Log.err(ex);
}
} | java | public static void close(Closeable...closeable) {
for(Closeable c : closeable)
try { if( c != null ) c.close(); } catch( IOException ex ) {
Log.err(ex);
}
} | [
"public",
"static",
"void",
"close",
"(",
"Closeable",
"...",
"closeable",
")",
"{",
"for",
"(",
"Closeable",
"c",
":",
"closeable",
")",
"try",
"{",
"if",
"(",
"c",
"!=",
"null",
")",
"c",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOExcepti... | Closes given files, logging exceptions thrown during the process of closing.
@param closeable files to close | [
"Closes",
"given",
"files",
"logging",
"exceptions",
"thrown",
"during",
"the",
"process",
"of",
"closing",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/FileUtils.java#L32-L37 |
131,091 | h2oai/h2o-3 | h2o-core/src/main/java/water/util/FileUtils.java | FileUtils.locateFile | public static File locateFile(String fname) {
// When run from eclipse, the working directory is different.
// Try pointing at another likely place
File file = new File(fname);
if( !file.exists() )
file = new File("target/" + fname);
if( !file.exists() )
file = new File("../" + fname);
... | java | public static File locateFile(String fname) {
// When run from eclipse, the working directory is different.
// Try pointing at another likely place
File file = new File(fname);
if( !file.exists() )
file = new File("target/" + fname);
if( !file.exists() )
file = new File("../" + fname);
... | [
"public",
"static",
"File",
"locateFile",
"(",
"String",
"fname",
")",
"{",
"// When run from eclipse, the working directory is different.",
"// Try pointing at another likely place",
"File",
"file",
"=",
"new",
"File",
"(",
"fname",
")",
";",
"if",
"(",
"!",
"file",
... | Hunt for files in likely places. Null if cannot find.
@param fname filename
@return Found file or null | [
"Hunt",
"for",
"files",
"in",
"likely",
"places",
".",
"Null",
"if",
"cannot",
"find",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/FileUtils.java#L89-L108 |
131,092 | h2oai/h2o-3 | h2o-core/src/main/java/water/api/FramesHandler.java | FramesHandler.list | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesListV3 list(int version, FramesListV3 s) {
Frames f = s.createAndFillImpl();
f.frames = Frame.fetchAll();
s.fillFromImplWithSynopsis(f);
return s;
} | java | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesListV3 list(int version, FramesListV3 s) {
Frames f = s.createAndFillImpl();
f.frames = Frame.fetchAll();
s.fillFromImplWithSynopsis(f);
return s;
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"// called through reflection by RequestServer",
"public",
"FramesListV3",
"list",
"(",
"int",
"version",
",",
"FramesListV3",
"s",
")",
"{",
"Frames",
"f",
"=",
"s",
".",
"createAndFillImpl",
"(",
")",
";",
"f",
... | Return all the frames. The Frames list will be instances of FrameSynopsisV3,
which only contains a few fields, for performance reasons.
@see FrameSynopsisV3 | [
"Return",
"all",
"the",
"frames",
".",
"The",
"Frames",
"list",
"will",
"be",
"instances",
"of",
"FrameSynopsisV3",
"which",
"only",
"contains",
"a",
"few",
"fields",
"for",
"performance",
"reasons",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/FramesHandler.java#L106-L114 |
131,093 | h2oai/h2o-3 | h2o-core/src/main/java/water/api/FramesHandler.java | FramesHandler.column | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesV3 column(int version, FramesV3 s) { // TODO: should return a Vec schema
Frame frame = getFromDKV("key", s.frame_id.key());
Vec vec = frame.vec(s.column);
if (null == vec)
throw new H2OColumnNotFoundArgumentExcep... | java | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesV3 column(int version, FramesV3 s) { // TODO: should return a Vec schema
Frame frame = getFromDKV("key", s.frame_id.key());
Vec vec = frame.vec(s.column);
if (null == vec)
throw new H2OColumnNotFoundArgumentExcep... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"// called through reflection by RequestServer",
"public",
"FramesV3",
"column",
"(",
"int",
"version",
",",
"FramesV3",
"s",
")",
"{",
"// TODO: should return a Vec schema",
"Frame",
"frame",
"=",
"getFromDKV",
"(",
"\"k... | Return a single column from the frame. | [
"Return",
"a",
"single",
"column",
"from",
"the",
"frame",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/FramesHandler.java#L149-L164 |
131,094 | h2oai/h2o-3 | h2o-core/src/main/java/water/api/FramesHandler.java | FramesHandler.fetch | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesV3 fetch(int version, FramesV3 s) {
FramesV3 frames = doFetch(version, s);
// Summary data is big, and not always there: null it out here. You have to call columnSummary
// to force computation of the summary data.
... | java | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesV3 fetch(int version, FramesV3 s) {
FramesV3 frames = doFetch(version, s);
// Summary data is big, and not always there: null it out here. You have to call columnSummary
// to force computation of the summary data.
... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"// called through reflection by RequestServer",
"public",
"FramesV3",
"fetch",
"(",
"int",
"version",
",",
"FramesV3",
"s",
")",
"{",
"FramesV3",
"frames",
"=",
"doFetch",
"(",
"version",
",",
"s",
")",
";",
"// ... | Return a single frame. | [
"Return",
"a",
"single",
"frame",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/FramesHandler.java#L197-L208 |
131,095 | h2oai/h2o-3 | h2o-core/src/main/java/water/api/FramesHandler.java | FramesHandler.export | public FramesV3 export(int version, FramesV3 s) {
Frame fr = getFromDKV("key", s.frame_id.key());
Log.info("ExportFiles processing (" + s.path + ")");
s.job = new JobV3(Frame.export(fr, s.path, s.frame_id.key().toString(), s.force, s.num_parts));
return s;
} | java | public FramesV3 export(int version, FramesV3 s) {
Frame fr = getFromDKV("key", s.frame_id.key());
Log.info("ExportFiles processing (" + s.path + ")");
s.job = new JobV3(Frame.export(fr, s.path, s.frame_id.key().toString(), s.force, s.num_parts));
return s;
} | [
"public",
"FramesV3",
"export",
"(",
"int",
"version",
",",
"FramesV3",
"s",
")",
"{",
"Frame",
"fr",
"=",
"getFromDKV",
"(",
"\"key\"",
",",
"s",
".",
"frame_id",
".",
"key",
"(",
")",
")",
";",
"Log",
".",
"info",
"(",
"\"ExportFiles processing (\"",
... | Export a single frame to the specified path. | [
"Export",
"a",
"single",
"frame",
"to",
"the",
"specified",
"path",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/FramesHandler.java#L244-L249 |
131,096 | h2oai/h2o-3 | h2o-core/src/main/java/water/api/FramesHandler.java | FramesHandler.delete | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesV3 delete(int version, FramesV3 frames) {
Frame frame = getFromDKV("key", frames.frame_id.key()); // safe
frame.delete(); // lock & remove
return frames;
} | java | @SuppressWarnings("unused") // called through reflection by RequestServer
public FramesV3 delete(int version, FramesV3 frames) {
Frame frame = getFromDKV("key", frames.frame_id.key()); // safe
frame.delete(); // lock & remove
return frames;
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"// called through reflection by RequestServer",
"public",
"FramesV3",
"delete",
"(",
"int",
"version",
",",
"FramesV3",
"frames",
")",
"{",
"Frame",
"frame",
"=",
"getFromDKV",
"(",
"\"key\"",
",",
"frames",
".",
"... | Remove an unlocked frame. Fails if frame is in-use. | [
"Remove",
"an",
"unlocked",
"frame",
".",
"Fails",
"if",
"frame",
"is",
"in",
"-",
"use",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/FramesHandler.java#L273-L278 |
131,097 | h2oai/h2o-3 | h2o-core/src/main/java/water/webserver/H2OHttpViewImpl.java | H2OHttpViewImpl.proxyLoginHandler | @Override
public boolean proxyLoginHandler(String target, HttpServletRequest request, HttpServletResponse response) throws IOException {
if (! isLoginTarget(target)) {
return false;
}
if (isPageRequest(request)) {
proxySendLoginForm(response);
} else {
response.sendError(HttpServlet... | java | @Override
public boolean proxyLoginHandler(String target, HttpServletRequest request, HttpServletResponse response) throws IOException {
if (! isLoginTarget(target)) {
return false;
}
if (isPageRequest(request)) {
proxySendLoginForm(response);
} else {
response.sendError(HttpServlet... | [
"@",
"Override",
"public",
"boolean",
"proxyLoginHandler",
"(",
"String",
"target",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"isLoginTarget",
"(",
"target",
")",
")",
"{",
"r... | proxy login handler part | [
"proxy",
"login",
"handler",
"part"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/webserver/H2OHttpViewImpl.java#L158-L170 |
131,098 | h2oai/h2o-3 | h2o-core/src/main/java/water/rapids/ast/prims/string/algorithms/LevenshteinDistanceComparator.java | LevenshteinDistanceComparator.distance | private double distance(final String a, final String b) {
if (a.isEmpty())
return b.length();
if (b.isEmpty())
return a.length();
if (a.equals(b))
return 0;
final int aLength = b.length();
final int bLength = a.length();
double[] v0 = new double[aLength + 1];
double[] v1 ... | java | private double distance(final String a, final String b) {
if (a.isEmpty())
return b.length();
if (b.isEmpty())
return a.length();
if (a.equals(b))
return 0;
final int aLength = b.length();
final int bLength = a.length();
double[] v0 = new double[aLength + 1];
double[] v1 ... | [
"private",
"double",
"distance",
"(",
"final",
"String",
"a",
",",
"final",
"String",
"b",
")",
"{",
"if",
"(",
"a",
".",
"isEmpty",
"(",
")",
")",
"return",
"b",
".",
"length",
"(",
")",
";",
"if",
"(",
"b",
".",
"isEmpty",
"(",
")",
")",
"ret... | Computes a case-sensitive Levenshtein distance of two strings
@param a First compared instance of {@link String}
@param b Second compared instance of {@link String}
@return Computed distance between two given strings | [
"Computes",
"a",
"case",
"-",
"sensitive",
"Levenshtein",
"distance",
"of",
"two",
"strings"
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/rapids/ast/prims/string/algorithms/LevenshteinDistanceComparator.java#L51-L93 |
131,099 | h2oai/h2o-3 | h2o-core/src/main/java/water/api/SchemaMetadata.java | SchemaMetadata.getFieldMetadata | public static List<FieldMetadata> getFieldMetadata(Schema schema) {
List<Field> superclassFields = Arrays.asList(Weaver.getWovenFields(schema.getClass().getSuperclass()));
List<FieldMetadata> fields = new ArrayList<>();
// Fields up to but not including Schema
for (Field field : Weaver.getWovenFields(s... | java | public static List<FieldMetadata> getFieldMetadata(Schema schema) {
List<Field> superclassFields = Arrays.asList(Weaver.getWovenFields(schema.getClass().getSuperclass()));
List<FieldMetadata> fields = new ArrayList<>();
// Fields up to but not including Schema
for (Field field : Weaver.getWovenFields(s... | [
"public",
"static",
"List",
"<",
"FieldMetadata",
">",
"getFieldMetadata",
"(",
"Schema",
"schema",
")",
"{",
"List",
"<",
"Field",
">",
"superclassFields",
"=",
"Arrays",
".",
"asList",
"(",
"Weaver",
".",
"getWovenFields",
"(",
"schema",
".",
"getClass",
"... | Returns metadata of all annotated fields.
@param schema a schema instance
@return list of field metadata | [
"Returns",
"metadata",
"of",
"all",
"annotated",
"fields",
"."
] | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/api/SchemaMetadata.java#L372-L383 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.