repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
apache/reef | lang/java/reef-utils/src/main/java/org/apache/reef/util/SimpleCondition.java | SimpleCondition.signal | public void signal() {
if (lockVar.isHeldByCurrentThread()) {
throw new RuntimeException("signal() must not be called on same thread as await()");
}
try {
lockVar.lock();
LOG.log(Level.INFO, "Signalling sleeper...");
isSignal = true;
conditionVar.signal();
} finally {
... | java | public void signal() {
if (lockVar.isHeldByCurrentThread()) {
throw new RuntimeException("signal() must not be called on same thread as await()");
}
try {
lockVar.lock();
LOG.log(Level.INFO, "Signalling sleeper...");
isSignal = true;
conditionVar.signal();
} finally {
... | [
"public",
"void",
"signal",
"(",
")",
"{",
"if",
"(",
"lockVar",
".",
"isHeldByCurrentThread",
"(",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"signal() must not be called on same thread as await()\"",
")",
";",
"}",
"try",
"{",
"lockVar",
".",
"l... | Wakes the thread sleeping in (@code await()}. | [
"Wakes",
"the",
"thread",
"sleeping",
"in",
"("
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-utils/src/main/java/org/apache/reef/util/SimpleCondition.java#L123-L135 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/DefaultRemoteManagerImplementation.java | DefaultRemoteManagerImplementation.getHandler | @Override
public <T> EventHandler<T> getHandler(
final RemoteIdentifier destinationIdentifier, final Class<? extends T> messageType) {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "RemoteManager: {0} destinationIdentifier: {1} messageType: {2}",
new Object[] {this.name, destination... | java | @Override
public <T> EventHandler<T> getHandler(
final RemoteIdentifier destinationIdentifier, final Class<? extends T> messageType) {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "RemoteManager: {0} destinationIdentifier: {1} messageType: {2}",
new Object[] {this.name, destination... | [
"@",
"Override",
"public",
"<",
"T",
">",
"EventHandler",
"<",
"T",
">",
"getHandler",
"(",
"final",
"RemoteIdentifier",
"destinationIdentifier",
",",
"final",
"Class",
"<",
"?",
"extends",
"T",
">",
"messageType",
")",
"{",
"if",
"(",
"LOG",
".",
"isLogga... | Returns a proxy event handler for a remote identifier and a message type. | [
"Returns",
"a",
"proxy",
"event",
"handler",
"for",
"a",
"remote",
"identifier",
"and",
"a",
"message",
"type",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/DefaultRemoteManagerImplementation.java#L111-L122 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/DefaultRemoteManagerImplementation.java | DefaultRemoteManagerImplementation.registerHandler | @Override
public <T, U extends T> AutoCloseable registerHandler(
final Class<U> messageType, final EventHandler<RemoteMessage<T>> theHandler) {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "RemoteManager: {0} messageType: {1} handler: {2}", new Object[] {
this.name, messageType.get... | java | @Override
public <T, U extends T> AutoCloseable registerHandler(
final Class<U> messageType, final EventHandler<RemoteMessage<T>> theHandler) {
if (LOG.isLoggable(Level.FINE)) {
LOG.log(Level.FINE, "RemoteManager: {0} messageType: {1} handler: {2}", new Object[] {
this.name, messageType.get... | [
"@",
"Override",
"public",
"<",
"T",
",",
"U",
"extends",
"T",
">",
"AutoCloseable",
"registerHandler",
"(",
"final",
"Class",
"<",
"U",
">",
"messageType",
",",
"final",
"EventHandler",
"<",
"RemoteMessage",
"<",
"T",
">",
">",
"theHandler",
")",
"{",
"... | Registers an event handler for a message type and returns a subscription. | [
"Registers",
"an",
"event",
"handler",
"for",
"a",
"message",
"type",
"and",
"returns",
"a",
"subscription",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/DefaultRemoteManagerImplementation.java#L143-L153 | train |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimManager.java | AzureBatchEvaluatorShimManager.onResourceRequested | public void onResourceRequested(final ResourceRequestEvent resourceRequestEvent,
final String containerId,
final URI jarFileUri) {
try {
createAzureBatchTask(containerId, jarFileUri);
this.outstandingResourceRequests.put(containerId, re... | java | public void onResourceRequested(final ResourceRequestEvent resourceRequestEvent,
final String containerId,
final URI jarFileUri) {
try {
createAzureBatchTask(containerId, jarFileUri);
this.outstandingResourceRequests.put(containerId, re... | [
"public",
"void",
"onResourceRequested",
"(",
"final",
"ResourceRequestEvent",
"resourceRequestEvent",
",",
"final",
"String",
"containerId",
",",
"final",
"URI",
"jarFileUri",
")",
"{",
"try",
"{",
"createAzureBatchTask",
"(",
"containerId",
",",
"jarFileUri",
")",
... | This method is called when a resource is requested. It will add a task to the existing Azure Batch job which
is equivalent to requesting a container in Azure Batch. When the request is fulfilled and the evaluator shim is
started, it will send a message back to the driver which signals that a resource request was fulfil... | [
"This",
"method",
"is",
"called",
"when",
"a",
"resource",
"is",
"requested",
".",
"It",
"will",
"add",
"a",
"task",
"to",
"the",
"existing",
"Azure",
"Batch",
"job",
"which",
"is",
"equivalent",
"to",
"requesting",
"a",
"container",
"in",
"Azure",
"Batch"... | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimManager.java#L155-L167 | train |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimManager.java | AzureBatchEvaluatorShimManager.onNext | @Override
public void onNext(final RemoteMessage<EvaluatorShimProtocol.EvaluatorShimStatusProto> statusMessage) {
EvaluatorShimProtocol.EvaluatorShimStatusProto message = statusMessage.getMessage();
String containerId = message.getContainerId();
String remoteId = message.getRemoteIdentifier();
LOG.l... | java | @Override
public void onNext(final RemoteMessage<EvaluatorShimProtocol.EvaluatorShimStatusProto> statusMessage) {
EvaluatorShimProtocol.EvaluatorShimStatusProto message = statusMessage.getMessage();
String containerId = message.getContainerId();
String remoteId = message.getRemoteIdentifier();
LOG.l... | [
"@",
"Override",
"public",
"void",
"onNext",
"(",
"final",
"RemoteMessage",
"<",
"EvaluatorShimProtocol",
".",
"EvaluatorShimStatusProto",
">",
"statusMessage",
")",
"{",
"EvaluatorShimProtocol",
".",
"EvaluatorShimStatusProto",
"message",
"=",
"statusMessage",
".",
"ge... | This method is invoked by the RemoteManager when a message from the evaluator shim is received.
@param statusMessage the message from the evaluator shim indicating that the shim has started and is ready to
start the evaluator process. | [
"This",
"method",
"is",
"invoked",
"by",
"the",
"RemoteManager",
"when",
"a",
"message",
"from",
"the",
"evaluator",
"shim",
"is",
"received",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimManager.java#L175-L192 | train |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimManager.java | AzureBatchEvaluatorShimManager.onClose | public void onClose() {
try {
this.evaluatorShimCommandChannel.close();
} catch (Exception e) {
LOG.log(Level.WARNING, "An unexpected exception while closing the Evaluator Shim Command channel: {0}", e);
throw new RuntimeException(e);
}
} | java | public void onClose() {
try {
this.evaluatorShimCommandChannel.close();
} catch (Exception e) {
LOG.log(Level.WARNING, "An unexpected exception while closing the Evaluator Shim Command channel: {0}", e);
throw new RuntimeException(e);
}
} | [
"public",
"void",
"onClose",
"(",
")",
"{",
"try",
"{",
"this",
".",
"evaluatorShimCommandChannel",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"WARNING",
",",
"\"An unexpected excepti... | Closes the evaluator shim remote manager command channel. | [
"Closes",
"the",
"evaluator",
"shim",
"remote",
"manager",
"command",
"channel",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimManager.java#L323-L330 | train |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimManager.java | AzureBatchEvaluatorShimManager.generateShimJarFile | public URI generateShimJarFile() {
try {
Set<FileResource> globalFiles = new HashSet<>();
final File globalFolder = new File(this.reefFileNames.getGlobalFolderPath());
final File[] filesInGlobalFolder = globalFolder.listFiles();
for (final File fileEntry : filesInGlobalFolder != null ? fi... | java | public URI generateShimJarFile() {
try {
Set<FileResource> globalFiles = new HashSet<>();
final File globalFolder = new File(this.reefFileNames.getGlobalFolderPath());
final File[] filesInGlobalFolder = globalFolder.listFiles();
for (final File fileEntry : filesInGlobalFolder != null ? fi... | [
"public",
"URI",
"generateShimJarFile",
"(",
")",
"{",
"try",
"{",
"Set",
"<",
"FileResource",
">",
"globalFiles",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"final",
"File",
"globalFolder",
"=",
"new",
"File",
"(",
"this",
".",
"reefFileNames",
".",
"g... | A utility method which builds the evaluator shim JAR file and uploads it to Azure Storage.
@return SAS URI to where the evaluator shim JAR was uploaded. | [
"A",
"utility",
"method",
"which",
"builds",
"the",
"evaluator",
"shim",
"JAR",
"file",
"and",
"uploads",
"it",
"to",
"Azure",
"Storage",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/driver/AzureBatchEvaluatorShimManager.java#L337-L358 | train |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/restart/DFSEvaluatorLogOverwriteReaderWriter.java | DFSEvaluatorLogOverwriteReaderWriter.getWritePath | private synchronized Path getWritePath() throws IOException {
if (pathToWriteTo == null) {
// If we have not yet written before, check existence of files.
final boolean originalExists = fileSystem.exists(changeLogPath);
final boolean altExists = fileSystem.exists(changeLogAltPath);
if (orig... | java | private synchronized Path getWritePath() throws IOException {
if (pathToWriteTo == null) {
// If we have not yet written before, check existence of files.
final boolean originalExists = fileSystem.exists(changeLogPath);
final boolean altExists = fileSystem.exists(changeLogAltPath);
if (orig... | [
"private",
"synchronized",
"Path",
"getWritePath",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"pathToWriteTo",
"==",
"null",
")",
"{",
"// If we have not yet written before, check existence of files.",
"final",
"boolean",
"originalExists",
"=",
"fileSystem",
".",
... | Gets the path to write to. | [
"Gets",
"the",
"path",
"to",
"write",
"to",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/restart/DFSEvaluatorLogOverwriteReaderWriter.java#L118-L152 | train |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/restart/DFSEvaluatorLogOverwriteReaderWriter.java | DFSEvaluatorLogOverwriteReaderWriter.close | @Override
public synchronized void close() throws Exception {
if (this.fileSystem != null && !this.fsClosed) {
this.fileSystem.close();
this.fsClosed = true;
}
} | java | @Override
public synchronized void close() throws Exception {
if (this.fileSystem != null && !this.fsClosed) {
this.fileSystem.close();
this.fsClosed = true;
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"close",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"this",
".",
"fileSystem",
"!=",
"null",
"&&",
"!",
"this",
".",
"fsClosed",
")",
"{",
"this",
".",
"fileSystem",
".",
"close",
"(",
")",
";",
... | Closes the FileSystem.
@throws Exception | [
"Closes",
"the",
"FileSystem",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/restart/DFSEvaluatorLogOverwriteReaderWriter.java#L185-L191 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/evaluator/VortexWorker.java | VortexWorker.call | @Override
public byte[] call(final byte[] memento) throws Exception {
final ExecutorService schedulerThread = Executors.newSingleThreadExecutor();
final ExecutorService commandExecutor = Executors.newFixedThreadPool(numOfThreads);
final ConcurrentMap<Integer, Future> futures = new ConcurrentHashMap<>();
... | java | @Override
public byte[] call(final byte[] memento) throws Exception {
final ExecutorService schedulerThread = Executors.newSingleThreadExecutor();
final ExecutorService commandExecutor = Executors.newFixedThreadPool(numOfThreads);
final ConcurrentMap<Integer, Future> futures = new ConcurrentHashMap<>();
... | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"call",
"(",
"final",
"byte",
"[",
"]",
"memento",
")",
"throws",
"Exception",
"{",
"final",
"ExecutorService",
"schedulerThread",
"=",
"Executors",
".",
"newSingleThreadExecutor",
"(",
")",
";",
"final",
"ExecutorS... | Starts the scheduler and executor and waits until termination. | [
"Starts",
"the",
"scheduler",
"and",
"executor",
"and",
"waits",
"until",
"termination",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/evaluator/VortexWorker.java#L77-L131 | train |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/NameCache.java | NameCache.get | @Override
public InetSocketAddress get(final Identifier key,
final Callable<InetSocketAddress> valueFetcher) throws ExecutionException {
return cache.get(key, valueFetcher);
} | java | @Override
public InetSocketAddress get(final Identifier key,
final Callable<InetSocketAddress> valueFetcher) throws ExecutionException {
return cache.get(key, valueFetcher);
} | [
"@",
"Override",
"public",
"InetSocketAddress",
"get",
"(",
"final",
"Identifier",
"key",
",",
"final",
"Callable",
"<",
"InetSocketAddress",
">",
"valueFetcher",
")",
"throws",
"ExecutionException",
"{",
"return",
"cache",
".",
"get",
"(",
"key",
",",
"valueFet... | Gets an address for an identifier.
@param key an identifier
@param valueFetcher a callable to load a value for the corresponding identifier
@return an Internet socket address
@throws ExecutionException | [
"Gets",
"an",
"address",
"for",
"an",
"identifier",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/NameCache.java#L54-L58 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ResourceManager.java | ResourceManager.onResourceReleaseRequest | void onResourceReleaseRequest(final ResourceReleaseEvent releaseRequest) {
synchronized (this.theContainers) {
LOG.log(Level.FINEST, "Release container: {0}", releaseRequest.getIdentifier());
this.theContainers.release(releaseRequest.getIdentifier());
this.checkRequestQueue();
}
} | java | void onResourceReleaseRequest(final ResourceReleaseEvent releaseRequest) {
synchronized (this.theContainers) {
LOG.log(Level.FINEST, "Release container: {0}", releaseRequest.getIdentifier());
this.theContainers.release(releaseRequest.getIdentifier());
this.checkRequestQueue();
}
} | [
"void",
"onResourceReleaseRequest",
"(",
"final",
"ResourceReleaseEvent",
"releaseRequest",
")",
"{",
"synchronized",
"(",
"this",
".",
"theContainers",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Release container: {0}\"",
",",
"releaseRequest... | Receives and processes a resource release request.
@param releaseRequest the release request to be processed | [
"Receives",
"and",
"processes",
"a",
"resource",
"release",
"request",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ResourceManager.java#L132-L138 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ResourceManager.java | ResourceManager.onResourceLaunchRequest | void onResourceLaunchRequest(
final ResourceLaunchEvent launchRequest) {
synchronized (this.theContainers) {
final Container c = this.theContainers.get(launchRequest.getIdentifier());
try (final LoggingScope lb = this.loggingScopeFactory
.getNewLoggingScope("ResourceManager.onResource... | java | void onResourceLaunchRequest(
final ResourceLaunchEvent launchRequest) {
synchronized (this.theContainers) {
final Container c = this.theContainers.get(launchRequest.getIdentifier());
try (final LoggingScope lb = this.loggingScopeFactory
.getNewLoggingScope("ResourceManager.onResource... | [
"void",
"onResourceLaunchRequest",
"(",
"final",
"ResourceLaunchEvent",
"launchRequest",
")",
"{",
"synchronized",
"(",
"this",
".",
"theContainers",
")",
"{",
"final",
"Container",
"c",
"=",
"this",
".",
"theContainers",
".",
"get",
"(",
"launchRequest",
".",
"... | Processes a resource launch request.
@param launchRequest the launch request to be processed. | [
"Processes",
"a",
"resource",
"launch",
"request",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ResourceManager.java#L157-L188 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/DefaultIdentifierFactory.java | DefaultIdentifierFactory.getNewInstance | @Override
public Identifier getNewInstance(final String str) {
final int index = str.indexOf("://");
if (index < 0) {
throw new RemoteRuntimeException("Invalid remote identifier name: " + str);
}
final String type = str.substring(0, index);
final Class<? extends Identifier> clazz = typeToC... | java | @Override
public Identifier getNewInstance(final String str) {
final int index = str.indexOf("://");
if (index < 0) {
throw new RemoteRuntimeException("Invalid remote identifier name: " + str);
}
final String type = str.substring(0, index);
final Class<? extends Identifier> clazz = typeToC... | [
"@",
"Override",
"public",
"Identifier",
"getNewInstance",
"(",
"final",
"String",
"str",
")",
"{",
"final",
"int",
"index",
"=",
"str",
".",
"indexOf",
"(",
"\"://\"",
")",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"throw",
"new",
"RemoteRuntimeExcep... | Creates a new remote identifier instance.
@param str a string representation
@return a remote identifier
@throws RemoteRuntimeException | [
"Creates",
"a",
"new",
"remote",
"identifier",
"instance",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/DefaultIdentifierFactory.java#L76-L101 | train |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/NamingCodecFactory.java | NamingCodecFactory.createLookupCodec | static Codec<NamingMessage> createLookupCodec(final IdentifierFactory factory) {
final Map<Class<? extends NamingMessage>, Codec<? extends NamingMessage>> clazzToCodecMap
= new HashMap<>();
clazzToCodecMap.put(NamingLookupRequest.class, new NamingLookupRequestCodec(factory));
clazzToCodecMap.put(Nam... | java | static Codec<NamingMessage> createLookupCodec(final IdentifierFactory factory) {
final Map<Class<? extends NamingMessage>, Codec<? extends NamingMessage>> clazzToCodecMap
= new HashMap<>();
clazzToCodecMap.put(NamingLookupRequest.class, new NamingLookupRequestCodec(factory));
clazzToCodecMap.put(Nam... | [
"static",
"Codec",
"<",
"NamingMessage",
">",
"createLookupCodec",
"(",
"final",
"IdentifierFactory",
"factory",
")",
"{",
"final",
"Map",
"<",
"Class",
"<",
"?",
"extends",
"NamingMessage",
">",
",",
"Codec",
"<",
"?",
"extends",
"NamingMessage",
">",
">",
... | Creates a codec only for lookup.
@param factory an identifier factory
@return a codec | [
"Creates",
"a",
"codec",
"only",
"for",
"lookup",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/NamingCodecFactory.java#L40-L47 | train |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/NamingCodecFactory.java | NamingCodecFactory.createRegistryCodec | static Codec<NamingMessage> createRegistryCodec(final IdentifierFactory factory) {
final Map<Class<? extends NamingMessage>, Codec<? extends NamingMessage>> clazzToCodecMap
= new HashMap<>();
clazzToCodecMap.put(NamingRegisterRequest.class, new NamingRegisterRequestCodec(factory));
clazzToCodecMap.p... | java | static Codec<NamingMessage> createRegistryCodec(final IdentifierFactory factory) {
final Map<Class<? extends NamingMessage>, Codec<? extends NamingMessage>> clazzToCodecMap
= new HashMap<>();
clazzToCodecMap.put(NamingRegisterRequest.class, new NamingRegisterRequestCodec(factory));
clazzToCodecMap.p... | [
"static",
"Codec",
"<",
"NamingMessage",
">",
"createRegistryCodec",
"(",
"final",
"IdentifierFactory",
"factory",
")",
"{",
"final",
"Map",
"<",
"Class",
"<",
"?",
"extends",
"NamingMessage",
">",
",",
"Codec",
"<",
"?",
"extends",
"NamingMessage",
">",
">",
... | Creates a codec only for registration.
@param factory an identifier factory
@return a codec | [
"Creates",
"a",
"codec",
"only",
"for",
"registration",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/NamingCodecFactory.java#L55-L64 | train |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/NamingCodecFactory.java | NamingCodecFactory.createFullCodec | static Codec<NamingMessage> createFullCodec(final IdentifierFactory factory) {
final Map<Class<? extends NamingMessage>, Codec<? extends NamingMessage>> clazzToCodecMap
= new HashMap<>();
clazzToCodecMap.put(NamingLookupRequest.class, new NamingLookupRequestCodec(factory));
clazzToCodecMap.put(Namin... | java | static Codec<NamingMessage> createFullCodec(final IdentifierFactory factory) {
final Map<Class<? extends NamingMessage>, Codec<? extends NamingMessage>> clazzToCodecMap
= new HashMap<>();
clazzToCodecMap.put(NamingLookupRequest.class, new NamingLookupRequestCodec(factory));
clazzToCodecMap.put(Namin... | [
"static",
"Codec",
"<",
"NamingMessage",
">",
"createFullCodec",
"(",
"final",
"IdentifierFactory",
"factory",
")",
"{",
"final",
"Map",
"<",
"Class",
"<",
"?",
"extends",
"NamingMessage",
">",
",",
"Codec",
"<",
"?",
"extends",
"NamingMessage",
">",
">",
"c... | Creates a codec for both lookup and registration.
@param factory an identifier factory
@return a codec | [
"Creates",
"a",
"codec",
"for",
"both",
"lookup",
"and",
"registration",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/naming/NamingCodecFactory.java#L72-L83 | train |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/group/bgd/BGDClient.java | BGDClient.submit | public void submit(final Configuration runtimeConfiguration, final String jobName) throws Exception {
final Configuration driverConfiguration = getDriverConfiguration(jobName);
Tang.Factory.getTang().newInjector(runtimeConfiguration).getInstance(REEF.class).submit(driverConfiguration);
} | java | public void submit(final Configuration runtimeConfiguration, final String jobName) throws Exception {
final Configuration driverConfiguration = getDriverConfiguration(jobName);
Tang.Factory.getTang().newInjector(runtimeConfiguration).getInstance(REEF.class).submit(driverConfiguration);
} | [
"public",
"void",
"submit",
"(",
"final",
"Configuration",
"runtimeConfiguration",
",",
"final",
"String",
"jobName",
")",
"throws",
"Exception",
"{",
"final",
"Configuration",
"driverConfiguration",
"=",
"getDriverConfiguration",
"(",
"jobName",
")",
";",
"Tang",
"... | Runs BGD on the given runtime.
@param runtimeConfiguration the runtime to run on.
@param jobName the name of the job on the runtime. | [
"Runs",
"BGD",
"on",
"the",
"given",
"runtime",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/group/bgd/BGDClient.java#L71-L74 | train |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/group/bgd/BGDClient.java | BGDClient.run | public LauncherStatus run(final Configuration runtimeConfiguration,
final String jobName, final int timeout) throws Exception {
final Configuration driverConfiguration = getDriverConfiguration(jobName);
return DriverLauncher.getLauncher(runtimeConfiguration).run(driverConfiguration, ... | java | public LauncherStatus run(final Configuration runtimeConfiguration,
final String jobName, final int timeout) throws Exception {
final Configuration driverConfiguration = getDriverConfiguration(jobName);
return DriverLauncher.getLauncher(runtimeConfiguration).run(driverConfiguration, ... | [
"public",
"LauncherStatus",
"run",
"(",
"final",
"Configuration",
"runtimeConfiguration",
",",
"final",
"String",
"jobName",
",",
"final",
"int",
"timeout",
")",
"throws",
"Exception",
"{",
"final",
"Configuration",
"driverConfiguration",
"=",
"getDriverConfiguration",
... | Runs BGD on the given runtime - with timeout.
@param runtimeConfiguration the runtime to run on.
@param jobName the name of the job on the runtime.
@param timeout the time after which the job will be killed if not completed, in ms
@return job completion status | [
"Runs",
"BGD",
"on",
"the",
"given",
"runtime",
"-",
"with",
"timeout",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/group/bgd/BGDClient.java#L84-L88 | train |
apache/reef | lang/java/reef-webserver/src/main/java/org/apache/reef/webserver/AvroDriverInfoSerializer.java | AvroDriverInfoSerializer.toAvro | @Override
public AvroDriverInfo toAvro(final String id, final String startTime, final List<AvroReefServiceInfo> services) {
return AvroDriverInfo.newBuilder()
.setRemoteId(id)
.setStartTime(startTime)
.setServices(services)
.build();
} | java | @Override
public AvroDriverInfo toAvro(final String id, final String startTime, final List<AvroReefServiceInfo> services) {
return AvroDriverInfo.newBuilder()
.setRemoteId(id)
.setStartTime(startTime)
.setServices(services)
.build();
} | [
"@",
"Override",
"public",
"AvroDriverInfo",
"toAvro",
"(",
"final",
"String",
"id",
",",
"final",
"String",
"startTime",
",",
"final",
"List",
"<",
"AvroReefServiceInfo",
">",
"services",
")",
"{",
"return",
"AvroDriverInfo",
".",
"newBuilder",
"(",
")",
".",... | Build AvroDriverInfo object. | [
"Build",
"AvroDriverInfo",
"object",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-webserver/src/main/java/org/apache/reef/webserver/AvroDriverInfoSerializer.java#L44-L51 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/RemoteReceiverStage.java | RemoteReceiverStage.onNext | @Override
public void onNext(final TransportEvent value) {
LOG.log(Level.FINEST, "{0}", value);
stage.onNext(value);
} | java | @Override
public void onNext(final TransportEvent value) {
LOG.log(Level.FINEST, "{0}", value);
stage.onNext(value);
} | [
"@",
"Override",
"public",
"void",
"onNext",
"(",
"final",
"TransportEvent",
"value",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"{0}\"",
",",
"value",
")",
";",
"stage",
".",
"onNext",
"(",
"value",
")",
";",
"}"
] | Handles the received event.
@param value the event | [
"Handles",
"the",
"received",
"event",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/RemoteReceiverStage.java#L71-L75 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiEventHandler.java | MultiEventHandler.onNext | @Override
public void onNext(final T event) {
final EventHandler<T> handler = (EventHandler<T>) map.get(event.getClass());
if (handler == null) {
throw new WakeRuntimeException("No event " + event.getClass() + " handler");
}
handler.onNext(event);
} | java | @Override
public void onNext(final T event) {
final EventHandler<T> handler = (EventHandler<T>) map.get(event.getClass());
if (handler == null) {
throw new WakeRuntimeException("No event " + event.getClass() + " handler");
}
handler.onNext(event);
} | [
"@",
"Override",
"public",
"void",
"onNext",
"(",
"final",
"T",
"event",
")",
"{",
"final",
"EventHandler",
"<",
"T",
">",
"handler",
"=",
"(",
"EventHandler",
"<",
"T",
">",
")",
"map",
".",
"get",
"(",
"event",
".",
"getClass",
"(",
")",
")",
";"... | Invokes a specific handler for the event class type if it exists.
@param event an event
@throws WakeRuntimeException | [
"Invokes",
"a",
"specific",
"handler",
"for",
"the",
"event",
"class",
"type",
"if",
"it",
"exists",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiEventHandler.java#L50-L57 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/EvaluatorIdlenessThreadPool.java | EvaluatorIdlenessThreadPool.close | @Override
public void close() {
LOG.log(Level.FINE, "EvaluatorIdlenessThreadPool shutdown: begin");
this.executor.shutdown();
boolean isTerminated = false;
try {
isTerminated = this.executor.awaitTermination(this.waitInMillis, TimeUnit.MILLISECONDS);
} catch (final InterruptedException ex... | java | @Override
public void close() {
LOG.log(Level.FINE, "EvaluatorIdlenessThreadPool shutdown: begin");
this.executor.shutdown();
boolean isTerminated = false;
try {
isTerminated = this.executor.awaitTermination(this.waitInMillis, TimeUnit.MILLISECONDS);
} catch (final InterruptedException ex... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"EvaluatorIdlenessThreadPool shutdown: begin\"",
")",
";",
"this",
".",
"executor",
".",
"shutdown",
"(",
")",
";",
"boolean",
"isTerminated",
"="... | Shutdown the thread pool of idleness checkers. | [
"Shutdown",
"the",
"thread",
"pool",
"of",
"idleness",
"checkers",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/EvaluatorIdlenessThreadPool.java#L109-L130 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/context/ContextFactory.java | ContextFactory.newContext | public EvaluatorContext newContext(final String contextId, final Optional<String> parentID) {
synchronized (this.priorIds) {
if (this.priorIds.contains(contextId)) {
throw new IllegalStateException("Creating second EvaluatorContext instance for id " + contextId);
}
this.priorIds.add(contex... | java | public EvaluatorContext newContext(final String contextId, final Optional<String> parentID) {
synchronized (this.priorIds) {
if (this.priorIds.contains(contextId)) {
throw new IllegalStateException("Creating second EvaluatorContext instance for id " + contextId);
}
this.priorIds.add(contex... | [
"public",
"EvaluatorContext",
"newContext",
"(",
"final",
"String",
"contextId",
",",
"final",
"Optional",
"<",
"String",
">",
"parentID",
")",
"{",
"synchronized",
"(",
"this",
".",
"priorIds",
")",
"{",
"if",
"(",
"this",
".",
"priorIds",
".",
"contains",
... | Instantiate a new Context representer with the given id and parent id.
@param contextId
@param parentID
@return a new Context representer with the given id and parent id. | [
"Instantiate",
"a",
"new",
"Context",
"representer",
"with",
"the",
"given",
"id",
"and",
"parent",
"id",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/context/ContextFactory.java#L80-L96 | train |
apache/reef | lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeDefinitionBuilder.java | MultiRuntimeDefinitionBuilder.addRuntime | public MultiRuntimeDefinitionBuilder addRuntime(final Configuration config, final String runtimeName){
Validate.notNull(config, "runtime configuration module should not be null");
Validate.isTrue(StringUtils.isNotBlank(runtimeName),
"runtimeName should be non empty and non blank string");
final ... | java | public MultiRuntimeDefinitionBuilder addRuntime(final Configuration config, final String runtimeName){
Validate.notNull(config, "runtime configuration module should not be null");
Validate.isTrue(StringUtils.isNotBlank(runtimeName),
"runtimeName should be non empty and non blank string");
final ... | [
"public",
"MultiRuntimeDefinitionBuilder",
"addRuntime",
"(",
"final",
"Configuration",
"config",
",",
"final",
"String",
"runtimeName",
")",
"{",
"Validate",
".",
"notNull",
"(",
"config",
",",
"\"runtime configuration module should not be null\"",
")",
";",
"Validate",
... | Adds runtime configuration module to the builder.
@param config The configuration module
@param runtimeName The name of the runtime
@return The builder instance | [
"Adds",
"runtime",
"configuration",
"module",
"to",
"the",
"builder",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeDefinitionBuilder.java#L55-L62 | train |
apache/reef | lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeDefinitionBuilder.java | MultiRuntimeDefinitionBuilder.setDefaultRuntimeName | public MultiRuntimeDefinitionBuilder setDefaultRuntimeName(final String runtimeName){
Validate.isTrue(StringUtils.isNotBlank(runtimeName),
"runtimeName should be non empty and non blank string");
this.defaultRuntime = runtimeName;
return this;
} | java | public MultiRuntimeDefinitionBuilder setDefaultRuntimeName(final String runtimeName){
Validate.isTrue(StringUtils.isNotBlank(runtimeName),
"runtimeName should be non empty and non blank string");
this.defaultRuntime = runtimeName;
return this;
} | [
"public",
"MultiRuntimeDefinitionBuilder",
"setDefaultRuntimeName",
"(",
"final",
"String",
"runtimeName",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"runtimeName",
")",
",",
"\"runtimeName should be non empty and non blank string\"",
"... | Sets default runtime name.
@param runtimeName The name of the default runtime
@return The builder instance | [
"Sets",
"default",
"runtime",
"name",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeDefinitionBuilder.java#L69-L74 | train |
apache/reef | lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeDefinitionBuilder.java | MultiRuntimeDefinitionBuilder.build | public AvroMultiRuntimeDefinition build(){
Validate.isTrue(this.runtimes.size() == 1 || !StringUtils.isEmpty(this.defaultRuntime), "Default runtime " +
"should be set if more than a single runtime provided");
if(StringUtils.isEmpty(this.defaultRuntime)){
// we have single runtime configured, ... | java | public AvroMultiRuntimeDefinition build(){
Validate.isTrue(this.runtimes.size() == 1 || !StringUtils.isEmpty(this.defaultRuntime), "Default runtime " +
"should be set if more than a single runtime provided");
if(StringUtils.isEmpty(this.defaultRuntime)){
// we have single runtime configured, ... | [
"public",
"AvroMultiRuntimeDefinition",
"build",
"(",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"this",
".",
"runtimes",
".",
"size",
"(",
")",
"==",
"1",
"||",
"!",
"StringUtils",
".",
"isEmpty",
"(",
"this",
".",
"defaultRuntime",
")",
",",
"\"Default ru... | Builds multi runtime definition.
@return The populated definition object | [
"Builds",
"multi",
"runtime",
"definition",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeDefinitionBuilder.java#L80-L91 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/FileSet.java | FileSet.copyTo | void copyTo(final File destinationFolder) throws IOException {
for (final File f : this.theFiles) {
final File destinationFile = new File(destinationFolder, f.getName());
Files.copy(f.toPath(), destinationFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
}
} | java | void copyTo(final File destinationFolder) throws IOException {
for (final File f : this.theFiles) {
final File destinationFile = new File(destinationFolder, f.getName());
Files.copy(f.toPath(), destinationFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING);
}
} | [
"void",
"copyTo",
"(",
"final",
"File",
"destinationFolder",
")",
"throws",
"IOException",
"{",
"for",
"(",
"final",
"File",
"f",
":",
"this",
".",
"theFiles",
")",
"{",
"final",
"File",
"destinationFile",
"=",
"new",
"File",
"(",
"destinationFolder",
",",
... | Copies all files in the current FileSet to the given destinationFolder.
@param destinationFolder the folder where the files shall be copied to.
@throws IOException | [
"Copies",
"all",
"files",
"in",
"the",
"current",
"FileSet",
"to",
"the",
"given",
"destinationFolder",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/FileSet.java#L79-L84 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/FileSet.java | FileSet.createSymbolicLinkTo | void createSymbolicLinkTo(final File destinationFolder) throws IOException {
for (final File f : this.theFiles) {
final File destinationFile = new File(destinationFolder, f.getName());
Files.createSymbolicLink(destinationFile.toPath(), f.toPath());
}
} | java | void createSymbolicLinkTo(final File destinationFolder) throws IOException {
for (final File f : this.theFiles) {
final File destinationFile = new File(destinationFolder, f.getName());
Files.createSymbolicLink(destinationFile.toPath(), f.toPath());
}
} | [
"void",
"createSymbolicLinkTo",
"(",
"final",
"File",
"destinationFolder",
")",
"throws",
"IOException",
"{",
"for",
"(",
"final",
"File",
"f",
":",
"this",
".",
"theFiles",
")",
"{",
"final",
"File",
"destinationFile",
"=",
"new",
"File",
"(",
"destinationFol... | Creates symbolic links for the current FileSet into the given destinationFolder.
@param destinationFolder the folder where the symbolic links will be created.
@throws IOException | [
"Creates",
"symbolic",
"links",
"for",
"the",
"current",
"FileSet",
"into",
"the",
"given",
"destinationFolder",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/FileSet.java#L92-L97 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/FileSet.java | FileSet.addNamesTo | ConfigurationModule addNamesTo(final ConfigurationModule input, final OptionalParameter<String> field) {
ConfigurationModule result = input;
for (final String fileName : this.fileNames()) {
result = result.set(field, fileName);
}
return result;
} | java | ConfigurationModule addNamesTo(final ConfigurationModule input, final OptionalParameter<String> field) {
ConfigurationModule result = input;
for (final String fileName : this.fileNames()) {
result = result.set(field, fileName);
}
return result;
} | [
"ConfigurationModule",
"addNamesTo",
"(",
"final",
"ConfigurationModule",
"input",
",",
"final",
"OptionalParameter",
"<",
"String",
">",
"field",
")",
"{",
"ConfigurationModule",
"result",
"=",
"input",
";",
"for",
"(",
"final",
"String",
"fileName",
":",
"this",... | Adds the file names of this FileSet to the given field of the given ConfigurationModule.
@param input the ConfigurationModule to fill out
@param field the field to add the files in this set to.
@return the filled out ConfigurationModule | [
"Adds",
"the",
"file",
"names",
"of",
"this",
"FileSet",
"to",
"the",
"given",
"field",
"of",
"the",
"given",
"ConfigurationModule",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/client/FileSet.java#L106-L112 | train |
apache/reef | lang/java/reef-webserver/src/main/java/org/apache/reef/webserver/AvroEvaluatorListSerializer.java | AvroEvaluatorListSerializer.toAvro | @Override
public AvroEvaluatorList toAvro(
final Map<String, EvaluatorDescriptor> evaluatorMap,
final int totalEvaluators, final String startTime) {
final List<AvroEvaluatorEntry> evaluatorEntities = new ArrayList<>();
for (final Map.Entry<String, EvaluatorDescriptor> entry : evaluatorMap.entryS... | java | @Override
public AvroEvaluatorList toAvro(
final Map<String, EvaluatorDescriptor> evaluatorMap,
final int totalEvaluators, final String startTime) {
final List<AvroEvaluatorEntry> evaluatorEntities = new ArrayList<>();
for (final Map.Entry<String, EvaluatorDescriptor> entry : evaluatorMap.entryS... | [
"@",
"Override",
"public",
"AvroEvaluatorList",
"toAvro",
"(",
"final",
"Map",
"<",
"String",
",",
"EvaluatorDescriptor",
">",
"evaluatorMap",
",",
"final",
"int",
"totalEvaluators",
",",
"final",
"String",
"startTime",
")",
"{",
"final",
"List",
"<",
"AvroEvalu... | Build AvroEvaluatorList object. | [
"Build",
"AvroEvaluatorList",
"object",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-webserver/src/main/java/org/apache/reef/webserver/AvroEvaluatorListSerializer.java#L48-L68 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/MultiDecoder.java | MultiDecoder.decode | @Override
public T decode(final byte[] data) {
final WakeTuplePBuf tuple;
try {
tuple = WakeTuplePBuf.parseFrom(data);
} catch (final InvalidProtocolBufferException e) {
e.printStackTrace();
throw new RemoteRuntimeException(e);
}
final String className = tuple.getClassName();
... | java | @Override
public T decode(final byte[] data) {
final WakeTuplePBuf tuple;
try {
tuple = WakeTuplePBuf.parseFrom(data);
} catch (final InvalidProtocolBufferException e) {
e.printStackTrace();
throw new RemoteRuntimeException(e);
}
final String className = tuple.getClassName();
... | [
"@",
"Override",
"public",
"T",
"decode",
"(",
"final",
"byte",
"[",
"]",
"data",
")",
"{",
"final",
"WakeTuplePBuf",
"tuple",
";",
"try",
"{",
"tuple",
"=",
"WakeTuplePBuf",
".",
"parseFrom",
"(",
"data",
")",
";",
"}",
"catch",
"(",
"final",
"Invalid... | Decodes byte array.
@param data class name and byte payload | [
"Decodes",
"byte",
"array",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/MultiDecoder.java#L51-L71 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextLifeCycle.java | ContextLifeCycle.start | void start() {
final ContextStart contextStart = new ContextStartImpl(this.identifier);
for (final EventHandler<ContextStart> startHandler : this.contextStartHandlers) {
startHandler.onNext(contextStart);
}
} | java | void start() {
final ContextStart contextStart = new ContextStartImpl(this.identifier);
for (final EventHandler<ContextStart> startHandler : this.contextStartHandlers) {
startHandler.onNext(contextStart);
}
} | [
"void",
"start",
"(",
")",
"{",
"final",
"ContextStart",
"contextStart",
"=",
"new",
"ContextStartImpl",
"(",
"this",
".",
"identifier",
")",
";",
"for",
"(",
"final",
"EventHandler",
"<",
"ContextStart",
">",
"startHandler",
":",
"this",
".",
"contextStartHan... | Fires ContextStart to all registered event handlers. | [
"Fires",
"ContextStart",
"to",
"all",
"registered",
"event",
"handlers",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextLifeCycle.java#L61-L66 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextLifeCycle.java | ContextLifeCycle.close | void close() {
final ContextStop contextStop = new ContextStopImpl(this.identifier);
for (final EventHandler<ContextStop> stopHandler : this.contextStopHandlers) {
stopHandler.onNext(contextStop);
}
} | java | void close() {
final ContextStop contextStop = new ContextStopImpl(this.identifier);
for (final EventHandler<ContextStop> stopHandler : this.contextStopHandlers) {
stopHandler.onNext(contextStop);
}
} | [
"void",
"close",
"(",
")",
"{",
"final",
"ContextStop",
"contextStop",
"=",
"new",
"ContextStopImpl",
"(",
"this",
".",
"identifier",
")",
";",
"for",
"(",
"final",
"EventHandler",
"<",
"ContextStop",
">",
"stopHandler",
":",
"this",
".",
"contextStopHandlers"... | Fires ContextStop to all registered event handlers. | [
"Fires",
"ContextStop",
"to",
"all",
"registered",
"event",
"handlers",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextLifeCycle.java#L71-L76 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/examples/matmul/MatMulFunction.java | MatMulFunction.call | @Override
public MatMulOutput call(final MatMulInput input) throws Exception {
final int index = input.getIndex();
final Matrix<Double> leftMatrix = input.getLeftMatrix();
final Matrix<Double> rightMatrix = input.getRightMatrix();
final Matrix<Double> result = leftMatrix.multiply(rightMatrix);
ret... | java | @Override
public MatMulOutput call(final MatMulInput input) throws Exception {
final int index = input.getIndex();
final Matrix<Double> leftMatrix = input.getLeftMatrix();
final Matrix<Double> rightMatrix = input.getRightMatrix();
final Matrix<Double> result = leftMatrix.multiply(rightMatrix);
ret... | [
"@",
"Override",
"public",
"MatMulOutput",
"call",
"(",
"final",
"MatMulInput",
"input",
")",
"throws",
"Exception",
"{",
"final",
"int",
"index",
"=",
"input",
".",
"getIndex",
"(",
")",
";",
"final",
"Matrix",
"<",
"Double",
">",
"leftMatrix",
"=",
"inpu... | Computes multiplication of two matrices.
@param input Input which contains two matrices to multiply,
and index of the sub-matrix in the entire result.
@return Output which contains the sub-matrix and index of it in the entire result.
@throws Exception If the two matrices cannot be multiplied. | [
"Computes",
"multiplication",
"of",
"two",
"matrices",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/examples/matmul/MatMulFunction.java#L34-L41 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.submitTask | public void submitTask(final String evaluatorConfiguration, final String taskConfiguration) {
final Configuration contextConfiguration = ContextConfiguration.CONF
.set(ContextConfiguration.IDENTIFIER, "RootContext_" + this.getId())
.build();
final String contextConfigurationString = this.configu... | java | public void submitTask(final String evaluatorConfiguration, final String taskConfiguration) {
final Configuration contextConfiguration = ContextConfiguration.CONF
.set(ContextConfiguration.IDENTIFIER, "RootContext_" + this.getId())
.build();
final String contextConfigurationString = this.configu... | [
"public",
"void",
"submitTask",
"(",
"final",
"String",
"evaluatorConfiguration",
",",
"final",
"String",
"taskConfiguration",
")",
"{",
"final",
"Configuration",
"contextConfiguration",
"=",
"ContextConfiguration",
".",
"CONF",
".",
"set",
"(",
"ContextConfiguration",
... | Submit Task with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side.
@param evaluatorConfiguration
@param taskConfiguration | [
"Submit",
"Task",
"with",
"configuration",
"strings",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"bridge",
"and",
"the",
"configuration",
"strings",
"are",
"serialized",
"at",
".",
"Net",
"side",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L109-L116 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.submitContext | public void submitContext(final String evaluatorConfiguration, final String contextConfiguration) {
launchWithConfigurationString(evaluatorConfiguration, contextConfiguration, Optional.<String>empty(),
Optional.<String>empty());
} | java | public void submitContext(final String evaluatorConfiguration, final String contextConfiguration) {
launchWithConfigurationString(evaluatorConfiguration, contextConfiguration, Optional.<String>empty(),
Optional.<String>empty());
} | [
"public",
"void",
"submitContext",
"(",
"final",
"String",
"evaluatorConfiguration",
",",
"final",
"String",
"contextConfiguration",
")",
"{",
"launchWithConfigurationString",
"(",
"evaluatorConfiguration",
",",
"contextConfiguration",
",",
"Optional",
".",
"<",
"String",... | Submit Context with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side.
@param evaluatorConfiguration
@param contextConfiguration | [
"Submit",
"Context",
"with",
"configuration",
"strings",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"bridge",
"and",
"the",
"configuration",
"strings",
"are",
"serialized",
"at",
".",
"Net",
"side",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L135-L138 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.submitContextAndService | public void submitContextAndService(final String evaluatorConfiguration,
final String contextConfiguration,
final String serviceConfiguration) {
launchWithConfigurationString(evaluatorConfiguration, contextConfiguration,
Optional.of... | java | public void submitContextAndService(final String evaluatorConfiguration,
final String contextConfiguration,
final String serviceConfiguration) {
launchWithConfigurationString(evaluatorConfiguration, contextConfiguration,
Optional.of... | [
"public",
"void",
"submitContextAndService",
"(",
"final",
"String",
"evaluatorConfiguration",
",",
"final",
"String",
"contextConfiguration",
",",
"final",
"String",
"serviceConfiguration",
")",
"{",
"launchWithConfigurationString",
"(",
"evaluatorConfiguration",
",",
"con... | Submit Context and Service with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side.
@param evaluatorConfiguration
@param contextConfiguration
@param serviceConfiguration | [
"Submit",
"Context",
"and",
"Service",
"with",
"configuration",
"strings",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"bridge",
"and",
"the",
"configuration",
"strings",
"are",
"serialized",
"at",
".",
"Net",
"side",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L154-L159 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.submitContextAndTask | public void submitContextAndTask(final String evaluatorConfiguration,
final String contextConfiguration,
final String taskConfiguration) {
this.launchWithConfigurationString(evaluatorConfiguration, contextConfiguration,
Optional.<String>e... | java | public void submitContextAndTask(final String evaluatorConfiguration,
final String contextConfiguration,
final String taskConfiguration) {
this.launchWithConfigurationString(evaluatorConfiguration, contextConfiguration,
Optional.<String>e... | [
"public",
"void",
"submitContextAndTask",
"(",
"final",
"String",
"evaluatorConfiguration",
",",
"final",
"String",
"contextConfiguration",
",",
"final",
"String",
"taskConfiguration",
")",
"{",
"this",
".",
"launchWithConfigurationString",
"(",
"evaluatorConfiguration",
... | Submit Context and Task with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side.
@param evaluatorConfiguration
@param contextConfiguration
@param taskConfiguration | [
"Submit",
"Context",
"and",
"Task",
"with",
"configuration",
"strings",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"bridge",
"and",
"the",
"configuration",
"strings",
"are",
"serialized",
"at",
".",
"Net",
"side",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L175-L180 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.submitContextAndServiceAndTask | public void submitContextAndServiceAndTask(final String evaluatorConfiguration,
final String contextConfiguration,
final String serviceConfiguration,
final String taskConfiguration) {
... | java | public void submitContextAndServiceAndTask(final String evaluatorConfiguration,
final String contextConfiguration,
final String serviceConfiguration,
final String taskConfiguration) {
... | [
"public",
"void",
"submitContextAndServiceAndTask",
"(",
"final",
"String",
"evaluatorConfiguration",
",",
"final",
"String",
"contextConfiguration",
",",
"final",
"String",
"serviceConfiguration",
",",
"final",
"String",
"taskConfiguration",
")",
"{",
"launchWithConfigurat... | Submit Context and Service with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side
@param evaluatorConfiguration
@param contextConfiguration
@param serviceConfiguration
@param taskConfiguration | [
"Submit",
"Context",
"and",
"Service",
"with",
"configuration",
"strings",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"bridge",
"and",
"the",
"configuration",
"strings",
"are",
"serialized",
"at",
".",
"Net",
"side"
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L198-L204 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.launchWithConfigurationString | private void launchWithConfigurationString(
final String evaluatorConfiguration,
final String contextConfiguration,
final Optional<String> serviceConfiguration,
final Optional<String> taskConfiguration) {
try (final LoggingScope lb = loggingScopeFactory.evaluatorLaunch(this.getId())) {
... | java | private void launchWithConfigurationString(
final String evaluatorConfiguration,
final String contextConfiguration,
final Optional<String> serviceConfiguration,
final Optional<String> taskConfiguration) {
try (final LoggingScope lb = loggingScopeFactory.evaluatorLaunch(this.getId())) {
... | [
"private",
"void",
"launchWithConfigurationString",
"(",
"final",
"String",
"evaluatorConfiguration",
",",
"final",
"String",
"contextConfiguration",
",",
"final",
"Optional",
"<",
"String",
">",
"serviceConfiguration",
",",
"final",
"Optional",
"<",
"String",
">",
"t... | Submit Context, Service and Task with configuration strings.
This method should be called from bridge and the configuration strings are
serialized at .Net side
@param contextConfiguration
@param evaluatorConfiguration
@param serviceConfiguration
@param taskConfiguration | [
"Submit",
"Context",
"Service",
"and",
"Task",
"with",
"configuration",
"strings",
".",
"This",
"method",
"should",
"be",
"called",
"from",
"bridge",
"and",
"the",
"configuration",
"strings",
"are",
"serialized",
"at",
".",
"Net",
"side"
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L241-L256 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.makeEvaluatorConfiguration | private Configuration makeEvaluatorConfiguration(final Configuration contextConfiguration,
final Optional<Configuration> serviceConfiguration,
final Optional<Configuration> taskConfiguration) {
final String contex... | java | private Configuration makeEvaluatorConfiguration(final Configuration contextConfiguration,
final Optional<Configuration> serviceConfiguration,
final Optional<Configuration> taskConfiguration) {
final String contex... | [
"private",
"Configuration",
"makeEvaluatorConfiguration",
"(",
"final",
"Configuration",
"contextConfiguration",
",",
"final",
"Optional",
"<",
"Configuration",
">",
"serviceConfiguration",
",",
"final",
"Optional",
"<",
"Configuration",
">",
"taskConfiguration",
")",
"{"... | Make configuration for evaluator.
@param contextConfiguration
@param serviceConfiguration
@param taskConfiguration
@return Configuration | [
"Make",
"configuration",
"for",
"evaluator",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L279-L301 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.makeEvaluatorConfiguration | private Configuration makeEvaluatorConfiguration(final String contextConfiguration,
final Optional<String> evaluatorConfiguration,
final Optional<String> serviceConfiguration,
... | java | private Configuration makeEvaluatorConfiguration(final String contextConfiguration,
final Optional<String> evaluatorConfiguration,
final Optional<String> serviceConfiguration,
... | [
"private",
"Configuration",
"makeEvaluatorConfiguration",
"(",
"final",
"String",
"contextConfiguration",
",",
"final",
"Optional",
"<",
"String",
">",
"evaluatorConfiguration",
",",
"final",
"Optional",
"<",
"String",
">",
"serviceConfiguration",
",",
"final",
"Optiona... | Make configuration for Evaluator.
@param contextConfiguration
@param evaluatorConfiguration
@param serviceConfiguration
@param taskConfiguration
@return Configuration | [
"Make",
"configuration",
"for",
"Evaluator",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L311-L354 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java | AllocatedEvaluatorImpl.makeRootServiceConfiguration | private Optional<Configuration> makeRootServiceConfiguration(final Optional<Configuration> serviceConfiguration) {
final EvaluatorType evaluatorType = this.evaluatorManager.getEvaluatorDescriptor().getProcess().getType();
if (EvaluatorType.CLR == evaluatorType) {
LOG.log(Level.FINE, "Not using the Configu... | java | private Optional<Configuration> makeRootServiceConfiguration(final Optional<Configuration> serviceConfiguration) {
final EvaluatorType evaluatorType = this.evaluatorManager.getEvaluatorDescriptor().getProcess().getType();
if (EvaluatorType.CLR == evaluatorType) {
LOG.log(Level.FINE, "Not using the Configu... | [
"private",
"Optional",
"<",
"Configuration",
">",
"makeRootServiceConfiguration",
"(",
"final",
"Optional",
"<",
"Configuration",
">",
"serviceConfiguration",
")",
"{",
"final",
"EvaluatorType",
"evaluatorType",
"=",
"this",
".",
"evaluatorManager",
".",
"getEvaluatorDe... | Merges the Configurations provided by the evaluatorConfigurationProviders into the given
serviceConfiguration, if any. | [
"Merges",
"the",
"Configurations",
"provided",
"by",
"the",
"evaluatorConfigurationProviders",
"into",
"the",
"given",
"serviceConfiguration",
"if",
"any",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/AllocatedEvaluatorImpl.java#L360-L378 | train |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/util/Utils.java | Utils.parseList | public static <T extends Identifier> List<T> parseList(final String ids, final IdentifierFactory factory) {
final List<T> result = new ArrayList<>();
for (final String token : ids.split(DELIMITER)) {
result.add((T) factory.getNewInstance(token.trim()));
}
return result;
} | java | public static <T extends Identifier> List<T> parseList(final String ids, final IdentifierFactory factory) {
final List<T> result = new ArrayList<>();
for (final String token : ids.split(DELIMITER)) {
result.add((T) factory.getNewInstance(token.trim()));
}
return result;
} | [
"public",
"static",
"<",
"T",
"extends",
"Identifier",
">",
"List",
"<",
"T",
">",
"parseList",
"(",
"final",
"String",
"ids",
",",
"final",
"IdentifierFactory",
"factory",
")",
"{",
"final",
"List",
"<",
"T",
">",
"result",
"=",
"new",
"ArrayList",
"<>"... | Parse a string of multiple IDs.
@param ids A string containing multiple IDs
@param factory An Identifier factory
@param <T> A type
@return A list of identifier | [
"Parse",
"a",
"string",
"of",
"multiple",
"IDs",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/util/Utils.java#L49-L55 | train |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/impl/NetworkConnectionFactory.java | NetworkConnectionFactory.newConnection | @Override
public Connection<T> newConnection(final Identifier destId) {
final Connection<T> connection = connectionMap.get(destId);
if (connection == null) {
final Connection<T> newConnection = new NetworkConnection<>(this, destId);
connectionMap.putIfAbsent(destId, newConnection);
return c... | java | @Override
public Connection<T> newConnection(final Identifier destId) {
final Connection<T> connection = connectionMap.get(destId);
if (connection == null) {
final Connection<T> newConnection = new NetworkConnection<>(this, destId);
connectionMap.putIfAbsent(destId, newConnection);
return c... | [
"@",
"Override",
"public",
"Connection",
"<",
"T",
">",
"newConnection",
"(",
"final",
"Identifier",
"destId",
")",
"{",
"final",
"Connection",
"<",
"T",
">",
"connection",
"=",
"connectionMap",
".",
"get",
"(",
"destId",
")",
";",
"if",
"(",
"connection",... | Creates a new connection.
@param destId a destination identifier of NetworkConnectionService. | [
"Creates",
"a",
"new",
"connection",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/impl/NetworkConnectionFactory.java#L67-L77 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextManager.java | ContextManager.start | public void start() throws ContextClientCodeException {
synchronized (this.contextStack) {
LOG.log(Level.FINEST, "Instantiating root context.");
this.contextStack.push(this.launchContext.get().getRootContext());
if (this.launchContext.get().getInitialTaskConfiguration().isPresent()) {
LOG... | java | public void start() throws ContextClientCodeException {
synchronized (this.contextStack) {
LOG.log(Level.FINEST, "Instantiating root context.");
this.contextStack.push(this.launchContext.get().getRootContext());
if (this.launchContext.get().getInitialTaskConfiguration().isPresent()) {
LOG... | [
"public",
"void",
"start",
"(",
")",
"throws",
"ContextClientCodeException",
"{",
"synchronized",
"(",
"this",
".",
"contextStack",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Instantiating root context.\"",
")",
";",
"this",
".",
"contex... | Start the context manager. This initiates the root context.
@throws ContextClientCodeException if the root context can't be instantiated. | [
"Start",
"the",
"context",
"manager",
".",
"This",
"initiates",
"the",
"root",
"context",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextManager.java#L99-L113 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextManager.java | ContextManager.addContext | private void addContext(
final EvaluatorRuntimeProtocol.AddContextProto addContextProto)
throws ContextClientCodeException {
synchronized (this.contextStack) {
try {
final ContextRuntime currentTopContext = this.contextStack.peek();
if (!currentTopContext.getIdentifier().equals(... | java | private void addContext(
final EvaluatorRuntimeProtocol.AddContextProto addContextProto)
throws ContextClientCodeException {
synchronized (this.contextStack) {
try {
final ContextRuntime currentTopContext = this.contextStack.peek();
if (!currentTopContext.getIdentifier().equals(... | [
"private",
"void",
"addContext",
"(",
"final",
"EvaluatorRuntimeProtocol",
".",
"AddContextProto",
"addContextProto",
")",
"throws",
"ContextClientCodeException",
"{",
"synchronized",
"(",
"this",
".",
"contextStack",
")",
"{",
"try",
"{",
"final",
"ContextRuntime",
"... | Add a context to the stack.
@param addContextProto
@throws ContextClientCodeException if there is a client code related issue. | [
"Add",
"a",
"context",
"to",
"the",
"stack",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextManager.java#L238-L271 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextManager.java | ContextManager.removeContext | private void removeContext(final String contextID) {
synchronized (this.contextStack) {
if (!contextID.equals(this.contextStack.peek().getIdentifier())) {
throw new IllegalStateException("Trying to close context with id `" + contextID +
"`. But the top context has id `" +
thi... | java | private void removeContext(final String contextID) {
synchronized (this.contextStack) {
if (!contextID.equals(this.contextStack.peek().getIdentifier())) {
throw new IllegalStateException("Trying to close context with id `" + contextID +
"`. But the top context has id `" +
thi... | [
"private",
"void",
"removeContext",
"(",
"final",
"String",
"contextID",
")",
"{",
"synchronized",
"(",
"this",
".",
"contextStack",
")",
"{",
"if",
"(",
"!",
"contextID",
".",
"equals",
"(",
"this",
".",
"contextStack",
".",
"peek",
"(",
")",
".",
"getI... | Remove the context with the given ID from the stack.
@throws IllegalStateException if the given ID does not refer to the top of stack. | [
"Remove",
"the",
"context",
"with",
"the",
"given",
"ID",
"from",
"the",
"stack",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextManager.java#L278-L304 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextManager.java | ContextManager.startTask | private void startTask(
final EvaluatorRuntimeProtocol.StartTaskProto startTaskProto) throws TaskClientCodeException {
synchronized (this.contextStack) {
final ContextRuntime currentActiveContext = this.contextStack.peek();
final String expectedContextId = startTaskProto.getContextId();
i... | java | private void startTask(
final EvaluatorRuntimeProtocol.StartTaskProto startTaskProto) throws TaskClientCodeException {
synchronized (this.contextStack) {
final ContextRuntime currentActiveContext = this.contextStack.peek();
final String expectedContextId = startTaskProto.getContextId();
i... | [
"private",
"void",
"startTask",
"(",
"final",
"EvaluatorRuntimeProtocol",
".",
"StartTaskProto",
"startTaskProto",
")",
"throws",
"TaskClientCodeException",
"{",
"synchronized",
"(",
"this",
".",
"contextStack",
")",
"{",
"final",
"ContextRuntime",
"currentActiveContext",... | Launch a Task. | [
"Launch",
"a",
"Task",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/evaluator/context/ContextManager.java#L309-L330 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/metrics/Meter.java | Meter.mark | public void mark(final long n) {
tickIfNecessary();
count.addAndGet(n);
m1Thp.update(n);
m5Thp.update(n);
m15Thp.update(n);
} | java | public void mark(final long n) {
tickIfNecessary();
count.addAndGet(n);
m1Thp.update(n);
m5Thp.update(n);
m15Thp.update(n);
} | [
"public",
"void",
"mark",
"(",
"final",
"long",
"n",
")",
"{",
"tickIfNecessary",
"(",
")",
";",
"count",
".",
"addAndGet",
"(",
"n",
")",
";",
"m1Thp",
".",
"update",
"(",
"n",
")",
";",
"m5Thp",
".",
"update",
"(",
"n",
")",
";",
"m15Thp",
".",... | Marks the number of events.
@param n the number of events | [
"Marks",
"the",
"number",
"of",
"events",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/metrics/Meter.java#L69-L75 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/metrics/Meter.java | Meter.getMeanThp | public double getMeanThp() {
if (getCount() == 0) {
return 0.0;
} else {
final double elapsed = getTick() - startTime;
return getCount() / elapsed * TimeUnit.SECONDS.toNanos(1);
}
} | java | public double getMeanThp() {
if (getCount() == 0) {
return 0.0;
} else {
final double elapsed = getTick() - startTime;
return getCount() / elapsed * TimeUnit.SECONDS.toNanos(1);
}
} | [
"public",
"double",
"getMeanThp",
"(",
")",
"{",
"if",
"(",
"getCount",
"(",
")",
"==",
"0",
")",
"{",
"return",
"0.0",
";",
"}",
"else",
"{",
"final",
"double",
"elapsed",
"=",
"getTick",
"(",
")",
"-",
"startTime",
";",
"return",
"getCount",
"(",
... | Gets the mean throughput.
@return the mean throughput | [
"Gets",
"the",
"mean",
"throughput",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/metrics/Meter.java#L91-L98 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ContainerManager.java | ContainerManager.getPreferredNode | private Optional<String> getPreferredNode(final List<String> nodeNames) {
for (final String nodeName : nodeNames) {
final String possibleRack = this.racksPerNode.get(nodeName);
if (possibleRack != null && this.freeNodesPerRack.get(possibleRack).containsKey(nodeName)) {
return Optional.of(nodeNa... | java | private Optional<String> getPreferredNode(final List<String> nodeNames) {
for (final String nodeName : nodeNames) {
final String possibleRack = this.racksPerNode.get(nodeName);
if (possibleRack != null && this.freeNodesPerRack.get(possibleRack).containsKey(nodeName)) {
return Optional.of(nodeNa... | [
"private",
"Optional",
"<",
"String",
">",
"getPreferredNode",
"(",
"final",
"List",
"<",
"String",
">",
"nodeNames",
")",
"{",
"for",
"(",
"final",
"String",
"nodeName",
":",
"nodeNames",
")",
"{",
"final",
"String",
"possibleRack",
"=",
"this",
".",
"rac... | Returns the node name of the container to be allocated if it's available,
selected from the list of preferred node names.
If the list is empty, then an empty optional is returned.
@param nodeNames the list of preferred nodes.
@return the node name where to allocate the container. | [
"Returns",
"the",
"node",
"name",
"of",
"the",
"container",
"to",
"be",
"allocated",
"if",
"it",
"s",
"available",
"selected",
"from",
"the",
"list",
"of",
"preferred",
"node",
"names",
".",
"If",
"the",
"list",
"is",
"empty",
"then",
"an",
"empty",
"opt... | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ContainerManager.java#L254-L264 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ContainerManager.java | ContainerManager.allocateContainer | Optional<Container> allocateContainer(final ResourceRequestEvent requestEvent) {
Container container = null;
final Optional<String> nodeName = getPreferredNode(requestEvent.getNodeNameList());
if (nodeName.isPresent()) {
container = allocateBasedOnNode(
requestEvent.getMemorySize().orElse(... | java | Optional<Container> allocateContainer(final ResourceRequestEvent requestEvent) {
Container container = null;
final Optional<String> nodeName = getPreferredNode(requestEvent.getNodeNameList());
if (nodeName.isPresent()) {
container = allocateBasedOnNode(
requestEvent.getMemorySize().orElse(... | [
"Optional",
"<",
"Container",
">",
"allocateContainer",
"(",
"final",
"ResourceRequestEvent",
"requestEvent",
")",
"{",
"Container",
"container",
"=",
"null",
";",
"final",
"Optional",
"<",
"String",
">",
"nodeName",
"=",
"getPreferredNode",
"(",
"requestEvent",
"... | Allocates a container based on a request event. First it tries to match a
given node, if it cannot, it tries to get a spot in a rack.
@param requestEvent resource request event.
@return an optional with the container if allocated. | [
"Allocates",
"a",
"container",
"based",
"on",
"a",
"request",
"event",
".",
"First",
"it",
"tries",
"to",
"match",
"a",
"given",
"node",
"if",
"it",
"cannot",
"it",
"tries",
"to",
"get",
"a",
"spot",
"in",
"a",
"rack",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/driver/ContainerManager.java#L310-L331 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiObserverImpl.java | MultiObserverImpl.unimplemented | private <TEvent> void unimplemented(final long identifier, final TEvent event) {
LOG.log(Level.SEVERE, "Unimplemented event: [{0}]: {1}", new Object[] {identifier, event});
throw new RuntimeException("Event not supported: " + event);
} | java | private <TEvent> void unimplemented(final long identifier, final TEvent event) {
LOG.log(Level.SEVERE, "Unimplemented event: [{0}]: {1}", new Object[] {identifier, event});
throw new RuntimeException("Event not supported: " + event);
} | [
"private",
"<",
"TEvent",
">",
"void",
"unimplemented",
"(",
"final",
"long",
"identifier",
",",
"final",
"TEvent",
"event",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"\"Unimplemented event: [{0}]: {1}\"",
",",
"new",
"Object",
"[",
"]",... | Called when an event is received that does not have an onNext method definition
in TSubCls. Override in TSubClas to handle the error.
@param event A reference to an object which is an event not handled by TSubCls.
@param <TEvent> The type of the event being processed. | [
"Called",
"when",
"an",
"event",
"is",
"received",
"that",
"does",
"not",
"have",
"an",
"onNext",
"method",
"definition",
"in",
"TSubCls",
".",
"Override",
"in",
"TSubClas",
"to",
"handle",
"the",
"error",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiObserverImpl.java#L65-L68 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiObserverImpl.java | MultiObserverImpl.onNext | @Override
public <TEvent> void onNext(final long identifier, final TEvent event)
throws IllegalAccessException, InvocationTargetException {
// Get the reflection method for this call.
final Method onNext = methodMap.get(event.getClass().getName());
if (onNext != null) {
// Process the event.
... | java | @Override
public <TEvent> void onNext(final long identifier, final TEvent event)
throws IllegalAccessException, InvocationTargetException {
// Get the reflection method for this call.
final Method onNext = methodMap.get(event.getClass().getName());
if (onNext != null) {
// Process the event.
... | [
"@",
"Override",
"public",
"<",
"TEvent",
">",
"void",
"onNext",
"(",
"final",
"long",
"identifier",
",",
"final",
"TEvent",
"event",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"// Get the reflection method for this call.",
"final",
... | Generic event onNext method in the base interface which maps the call to a concrete
event onNext method in TSubCls if one exists otherwise unimplemented is invoked.
@param event An event of type TEvent which will be sent to TSubCls as appropriate.
@param <TEvent> The type of the event being processed. | [
"Generic",
"event",
"onNext",
"method",
"in",
"the",
"base",
"interface",
"which",
"maps",
"the",
"call",
"to",
"a",
"concrete",
"event",
"onNext",
"method",
"in",
"TSubCls",
"if",
"one",
"exists",
"otherwise",
"unimplemented",
"is",
"invoked",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiObserverImpl.java#L76-L89 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/process/RunnableProcess.java | RunnableProcess.run | @Override
public void run() {
this.stateLock.lock();
try {
if (this.state != RunnableProcessState.INIT) {
throw new IllegalStateException("The RunnableProcess can't be reused");
}
// Setup the stdout and stderr destinations.
final File errFile = new File(folder, standardErr... | java | @Override
public void run() {
this.stateLock.lock();
try {
if (this.state != RunnableProcessState.INIT) {
throw new IllegalStateException("The RunnableProcess can't be reused");
}
// Setup the stdout and stderr destinations.
final File errFile = new File(folder, standardErr... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"this",
".",
"stateLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"this",
".",
"state",
"!=",
"RunnableProcessState",
".",
"INIT",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(... | Runs the configured process.
@throws IllegalStateException if the process is already running or has been running before. | [
"Runs",
"the",
"configured",
"process",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/process/RunnableProcess.java#L169-L231 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/process/RunnableProcess.java | RunnableProcess.cancel | public void cancel() {
this.stateLock.lock();
try {
if (this.state == RunnableProcessState.RUNNING) {
this.process.destroy();
if (!this.doneCond.await(DESTROY_WAIT_TIME, TimeUnit.MILLISECONDS)) {
LOG.log(Level.FINE, "{0} milliseconds elapsed", DESTROY_WAIT_TIME);
}
... | java | public void cancel() {
this.stateLock.lock();
try {
if (this.state == RunnableProcessState.RUNNING) {
this.process.destroy();
if (!this.doneCond.await(DESTROY_WAIT_TIME, TimeUnit.MILLISECONDS)) {
LOG.log(Level.FINE, "{0} milliseconds elapsed", DESTROY_WAIT_TIME);
}
... | [
"public",
"void",
"cancel",
"(",
")",
"{",
"this",
".",
"stateLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"if",
"(",
"this",
".",
"state",
"==",
"RunnableProcessState",
".",
"RUNNING",
")",
"{",
"this",
".",
"process",
".",
"destroy",
"(",
")",
... | Cancels the running process if it is running. | [
"Cancels",
"the",
"running",
"process",
"if",
"it",
"is",
"running",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/process/RunnableProcess.java#L236-L269 | train |
apache/reef | lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/process/RunnableProcess.java | RunnableProcess.setState | private void setState(final RunnableProcessState newState) {
if (!this.state.isLegal(newState)) {
throw new IllegalStateException("Transition from " + this.state + " to " + newState + " is illegal");
}
this.state = newState;
} | java | private void setState(final RunnableProcessState newState) {
if (!this.state.isLegal(newState)) {
throw new IllegalStateException("Transition from " + this.state + " to " + newState + " is illegal");
}
this.state = newState;
} | [
"private",
"void",
"setState",
"(",
"final",
"RunnableProcessState",
"newState",
")",
"{",
"if",
"(",
"!",
"this",
".",
"state",
".",
"isLegal",
"(",
"newState",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Transition from \"",
"+",
"this",
... | Sets a new state for the process.
@param newState a new process state to transition to.
@throws IllegalStateException if the new state is illegal. | [
"Sets",
"a",
"new",
"state",
"for",
"the",
"process",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-local/src/main/java/org/apache/reef/runtime/local/process/RunnableProcess.java#L302-L307 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/Evaluators.java | Evaluators.close | @Override
public void close() {
LOG.log(Level.FINER, "Closing the evaluators - begin");
final List<EvaluatorManager> evaluatorsCopy;
synchronized (this) {
evaluatorsCopy = new ArrayList<>(this.evaluators.values());
}
for (final EvaluatorManager evaluatorManager : evaluatorsCopy) {
i... | java | @Override
public void close() {
LOG.log(Level.FINER, "Closing the evaluators - begin");
final List<EvaluatorManager> evaluatorsCopy;
synchronized (this) {
evaluatorsCopy = new ArrayList<>(this.evaluators.values());
}
for (final EvaluatorManager evaluatorManager : evaluatorsCopy) {
i... | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINER",
",",
"\"Closing the evaluators - begin\"",
")",
";",
"final",
"List",
"<",
"EvaluatorManager",
">",
"evaluatorsCopy",
";",
"synchronized",
"(",
"this",
... | Closes all EvaluatorManager instances managed. | [
"Closes",
"all",
"EvaluatorManager",
"instances",
"managed",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/Evaluators.java#L66-L84 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/Evaluators.java | Evaluators.put | public synchronized void put(final EvaluatorManager evaluatorManager) {
final String evaluatorId = evaluatorManager.getId();
if (this.wasClosed(evaluatorId)) {
throw new IllegalArgumentException(
"Trying to re-add an Evaluator that has already been closed: " + evaluatorId);
}
final Evaluat... | java | public synchronized void put(final EvaluatorManager evaluatorManager) {
final String evaluatorId = evaluatorManager.getId();
if (this.wasClosed(evaluatorId)) {
throw new IllegalArgumentException(
"Trying to re-add an Evaluator that has already been closed: " + evaluatorId);
}
final Evaluat... | [
"public",
"synchronized",
"void",
"put",
"(",
"final",
"EvaluatorManager",
"evaluatorManager",
")",
"{",
"final",
"String",
"evaluatorId",
"=",
"evaluatorManager",
".",
"getId",
"(",
")",
";",
"if",
"(",
"this",
".",
"wasClosed",
"(",
"evaluatorId",
")",
")",
... | Adds an EvaluatorManager.
@param evaluatorManager
@throws java.lang.IllegalArgumentException if the EvaluatorManager is already known. | [
"Adds",
"an",
"EvaluatorManager",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/Evaluators.java#L139-L151 | train |
apache/reef | lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/Evaluators.java | Evaluators.removeClosedEvaluator | public synchronized void removeClosedEvaluator(final EvaluatorManager evaluatorManager) {
final String evaluatorId = evaluatorManager.getId();
LOG.log(Level.FINE, "Removing closed evaluator: {0}", evaluatorId);
if (!evaluatorManager.isClosed()) {
throw new IllegalArgumentException("Removing evaluato... | java | public synchronized void removeClosedEvaluator(final EvaluatorManager evaluatorManager) {
final String evaluatorId = evaluatorManager.getId();
LOG.log(Level.FINE, "Removing closed evaluator: {0}", evaluatorId);
if (!evaluatorManager.isClosed()) {
throw new IllegalArgumentException("Removing evaluato... | [
"public",
"synchronized",
"void",
"removeClosedEvaluator",
"(",
"final",
"EvaluatorManager",
"evaluatorManager",
")",
"{",
"final",
"String",
"evaluatorId",
"=",
"evaluatorManager",
".",
"getId",
"(",
")",
";",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
... | Moves evaluator from map of active evaluators to set of closed evaluators. | [
"Moves",
"evaluator",
"from",
"map",
"of",
"active",
"evaluators",
"to",
"set",
"of",
"closed",
"evaluators",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-common/src/main/java/org/apache/reef/runtime/common/driver/evaluator/Evaluators.java#L156-L179 | train |
apache/reef | lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/generic/JobClient.java | JobClient.submit | public void submit(final File clrFolder, final boolean submitDriver,
final boolean local, final Configuration clientConfig) {
try (final LoggingScope ls = this.loggingScopeFactory.driverSubmit(submitDriver)) {
if (!local) {
this.driverConfiguration = Configurations.merge(this.driv... | java | public void submit(final File clrFolder, final boolean submitDriver,
final boolean local, final Configuration clientConfig) {
try (final LoggingScope ls = this.loggingScopeFactory.driverSubmit(submitDriver)) {
if (!local) {
this.driverConfiguration = Configurations.merge(this.driv... | [
"public",
"void",
"submit",
"(",
"final",
"File",
"clrFolder",
",",
"final",
"boolean",
"submitDriver",
",",
"final",
"boolean",
"local",
",",
"final",
"Configuration",
"clientConfig",
")",
"{",
"try",
"(",
"final",
"LoggingScope",
"ls",
"=",
"this",
".",
"l... | Launch the job driver.
@throws org.apache.reef.tang.exceptions.BindException configuration error. | [
"Launch",
"the",
"job",
"driver",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/generic/JobClient.java#L212-L237 | train |
apache/reef | lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/generic/JobClient.java | JobClient.setDriverInfo | @SuppressWarnings("checkstyle:hiddenfield")
public void setDriverInfo(final String identifier, final int memory, final String jobSubmissionDirectory) {
if (identifier == null || identifier.isEmpty()) {
throw new RuntimeException("driver id cannot be null or empty");
}
if (memory <= 0) {
throw ... | java | @SuppressWarnings("checkstyle:hiddenfield")
public void setDriverInfo(final String identifier, final int memory, final String jobSubmissionDirectory) {
if (identifier == null || identifier.isEmpty()) {
throw new RuntimeException("driver id cannot be null or empty");
}
if (memory <= 0) {
throw ... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:hiddenfield\"",
")",
"public",
"void",
"setDriverInfo",
"(",
"final",
"String",
"identifier",
",",
"final",
"int",
"memory",
",",
"final",
"String",
"jobSubmissionDirectory",
")",
"{",
"if",
"(",
"identifier",
"==",
"nul... | Set the driver memory. | [
"Set",
"the",
"driver",
"memory",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/generic/JobClient.java#L242-L257 | train |
apache/reef | lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/generic/JobClient.java | JobClient.waitForCompletion | public void waitForCompletion(final int waitTime) {
LOG.info("Waiting for the Job Driver to complete: " + waitTime);
if (waitTime == 0) {
close(0);
return;
} else if (waitTime < 0) {
waitTillDone();
}
final long endTime = System.currentTimeMillis() + waitTime * 1000;
close(endT... | java | public void waitForCompletion(final int waitTime) {
LOG.info("Waiting for the Job Driver to complete: " + waitTime);
if (waitTime == 0) {
close(0);
return;
} else if (waitTime < 0) {
waitTillDone();
}
final long endTime = System.currentTimeMillis() + waitTime * 1000;
close(endT... | [
"public",
"void",
"waitForCompletion",
"(",
"final",
"int",
"waitTime",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Waiting for the Job Driver to complete: \"",
"+",
"waitTime",
")",
";",
"if",
"(",
"waitTime",
"==",
"0",
")",
"{",
"close",
"(",
"0",
")",
";",
"... | Wait for the job driver to complete. | [
"Wait",
"for",
"the",
"job",
"driver",
"to",
"complete",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/generic/JobClient.java#L271-L281 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java | VortexFuture.cancel | @Override
public boolean cancel(final boolean mayInterruptIfRunning) {
try {
return cancel(mayInterruptIfRunning, Optional.<Long>empty(), Optional.<TimeUnit>empty());
} catch (final TimeoutException e) {
// This should never happen.
LOG.log(Level.WARNING, "Received a TimeoutException in Vort... | java | @Override
public boolean cancel(final boolean mayInterruptIfRunning) {
try {
return cancel(mayInterruptIfRunning, Optional.<Long>empty(), Optional.<TimeUnit>empty());
} catch (final TimeoutException e) {
// This should never happen.
LOG.log(Level.WARNING, "Received a TimeoutException in Vort... | [
"@",
"Override",
"public",
"boolean",
"cancel",
"(",
"final",
"boolean",
"mayInterruptIfRunning",
")",
"{",
"try",
"{",
"return",
"cancel",
"(",
"mayInterruptIfRunning",
",",
"Optional",
".",
"<",
"Long",
">",
"empty",
"(",
")",
",",
"Optional",
".",
"<",
... | Sends a cancel signal and blocks and waits until the task is cancelled, completed, or failed.
@return true if task did not start or was cancelled, false if task failed or completed | [
"Sends",
"a",
"cancel",
"signal",
"and",
"blocks",
"and",
"waits",
"until",
"the",
"task",
"is",
"cancelled",
"completed",
"or",
"failed",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L77-L86 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java | VortexFuture.cancel | public boolean cancel(final boolean mayInterruptIfRunning, final long timeout, final TimeUnit unit)
throws TimeoutException {
return cancel(mayInterruptIfRunning, Optional.of(timeout), Optional.of(unit));
} | java | public boolean cancel(final boolean mayInterruptIfRunning, final long timeout, final TimeUnit unit)
throws TimeoutException {
return cancel(mayInterruptIfRunning, Optional.of(timeout), Optional.of(unit));
} | [
"public",
"boolean",
"cancel",
"(",
"final",
"boolean",
"mayInterruptIfRunning",
",",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"unit",
")",
"throws",
"TimeoutException",
"{",
"return",
"cancel",
"(",
"mayInterruptIfRunning",
",",
"Optional",
".",
"of"... | Sends a cancel signal and blocks and waits until the task is cancelled, completed, or failed, or
if the timeout has expired.
@return true if task did not start or was cancelled, false if task failed or completed | [
"Sends",
"a",
"cancel",
"signal",
"and",
"blocks",
"and",
"waits",
"until",
"the",
"task",
"is",
"cancelled",
"completed",
"or",
"failed",
"or",
"if",
"the",
"timeout",
"has",
"expired",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L93-L96 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java | VortexFuture.get | @Override
public TOutput get() throws InterruptedException, ExecutionException, CancellationException {
countDownLatch.await();
if (userResult != null) {
return userResult.get();
} else {
assert this.cancelled.get() || userException != null;
if (userException != null) {
throw new... | java | @Override
public TOutput get() throws InterruptedException, ExecutionException, CancellationException {
countDownLatch.await();
if (userResult != null) {
return userResult.get();
} else {
assert this.cancelled.get() || userException != null;
if (userException != null) {
throw new... | [
"@",
"Override",
"public",
"TOutput",
"get",
"(",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"CancellationException",
"{",
"countDownLatch",
".",
"await",
"(",
")",
";",
"if",
"(",
"userResult",
"!=",
"null",
")",
"{",
"return",
"us... | Infinitely wait for the result of the task.
@throws InterruptedException if the thread is interrupted.
@throws ExecutionException if the Tasklet execution failed to complete.
@throws CancellationException if the Tasklet was cancelled. | [
"Infinitely",
"wait",
"for",
"the",
"result",
"of",
"the",
"task",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L146-L159 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java | VortexFuture.get | @Override
public TOutput get(final long timeout, final TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException, CancellationException {
if (!countDownLatch.await(timeout, unit)) {
throw new TimeoutException("Waiting for the results of the task timed out. Timeout = " + timeout
... | java | @Override
public TOutput get(final long timeout, final TimeUnit unit)
throws InterruptedException, ExecutionException, TimeoutException, CancellationException {
if (!countDownLatch.await(timeout, unit)) {
throw new TimeoutException("Waiting for the results of the task timed out. Timeout = " + timeout
... | [
"@",
"Override",
"public",
"TOutput",
"get",
"(",
"final",
"long",
"timeout",
",",
"final",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
",",
"ExecutionException",
",",
"TimeoutException",
",",
"CancellationException",
"{",
"if",
"(",
"!",
"countDown... | Wait a certain period of time for the result of the task.
@throws TimeoutException if the timeout provided hits before the Tasklet is done.
@throws InterruptedException if the thread is interrupted.
@throws ExecutionException if the Tasklet execution failed to complete.
@throws CancellationException if the Tasklet was ... | [
"Wait",
"a",
"certain",
"period",
"of",
"time",
"for",
"the",
"result",
"of",
"the",
"task",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L168-L177 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java | VortexFuture.completed | @Private
@Override
public void completed(final int pTaskletId, final TOutput result) {
assert taskletId == pTaskletId;
this.userResult = Optional.ofNullable(result);
if (callbackHandler != null) {
executor.execute(new Runnable() {
@Override
public void run() {
callbackHan... | java | @Private
@Override
public void completed(final int pTaskletId, final TOutput result) {
assert taskletId == pTaskletId;
this.userResult = Optional.ofNullable(result);
if (callbackHandler != null) {
executor.execute(new Runnable() {
@Override
public void run() {
callbackHan... | [
"@",
"Private",
"@",
"Override",
"public",
"void",
"completed",
"(",
"final",
"int",
"pTaskletId",
",",
"final",
"TOutput",
"result",
")",
"{",
"assert",
"taskletId",
"==",
"pTaskletId",
";",
"this",
".",
"userResult",
"=",
"Optional",
".",
"ofNullable",
"("... | Called by VortexMaster to let the user know that the Tasklet completed. | [
"Called",
"by",
"VortexMaster",
"to",
"let",
"the",
"user",
"know",
"that",
"the",
"Tasklet",
"completed",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L182-L196 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java | VortexFuture.threwException | @Private
@Override
public void threwException(final int pTaskletId, final Exception exception) {
assert taskletId == pTaskletId;
this.userException = exception;
if (callbackHandler != null) {
executor.execute(new Runnable() {
@Override
public void run() {
callbackHandler... | java | @Private
@Override
public void threwException(final int pTaskletId, final Exception exception) {
assert taskletId == pTaskletId;
this.userException = exception;
if (callbackHandler != null) {
executor.execute(new Runnable() {
@Override
public void run() {
callbackHandler... | [
"@",
"Private",
"@",
"Override",
"public",
"void",
"threwException",
"(",
"final",
"int",
"pTaskletId",
",",
"final",
"Exception",
"exception",
")",
"{",
"assert",
"taskletId",
"==",
"pTaskletId",
";",
"this",
".",
"userException",
"=",
"exception",
";",
"if",... | Called by VortexMaster to let the user know that the Tasklet threw an exception. | [
"Called",
"by",
"VortexMaster",
"to",
"let",
"the",
"user",
"know",
"that",
"the",
"Tasklet",
"threw",
"an",
"exception",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L210-L225 | train |
apache/reef | lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java | VortexFuture.cancelled | @Private
@Override
public void cancelled(final int pTaskletId) {
assert taskletId == pTaskletId;
this.cancelled.set(true);
if (callbackHandler != null) {
executor.execute(new Runnable() {
@Override
public void run() {
callbackHandler.onFailure(new InterruptedException("V... | java | @Private
@Override
public void cancelled(final int pTaskletId) {
assert taskletId == pTaskletId;
this.cancelled.set(true);
if (callbackHandler != null) {
executor.execute(new Runnable() {
@Override
public void run() {
callbackHandler.onFailure(new InterruptedException("V... | [
"@",
"Private",
"@",
"Override",
"public",
"void",
"cancelled",
"(",
"final",
"int",
"pTaskletId",
")",
"{",
"assert",
"taskletId",
"==",
"pTaskletId",
";",
"this",
".",
"cancelled",
".",
"set",
"(",
"true",
")",
";",
"if",
"(",
"callbackHandler",
"!=",
... | Called by VortexMaster to let the user know that the Tasklet was cancelled. | [
"Called",
"by",
"VortexMaster",
"to",
"let",
"the",
"user",
"know",
"that",
"the",
"Tasklet",
"was",
"cancelled",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/api/VortexFuture.java#L239-L254 | train |
apache/reef | lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/client/HDInsightJobSubmissionHandler.java | HDInsightJobSubmissionHandler.getResource | private Resource getResource(
final JobSubmissionEvent jobSubmissionEvent) {
return new Resource()
.setMemory(jobSubmissionEvent.getDriverMemory().get())
.setvCores(jobSubmissionEvent.getDriverCPUCores().get());
} | java | private Resource getResource(
final JobSubmissionEvent jobSubmissionEvent) {
return new Resource()
.setMemory(jobSubmissionEvent.getDriverMemory().get())
.setvCores(jobSubmissionEvent.getDriverCPUCores().get());
} | [
"private",
"Resource",
"getResource",
"(",
"final",
"JobSubmissionEvent",
"jobSubmissionEvent",
")",
"{",
"return",
"new",
"Resource",
"(",
")",
".",
"setMemory",
"(",
"jobSubmissionEvent",
".",
"getDriverMemory",
"(",
")",
".",
"get",
"(",
")",
")",
".",
"set... | Extracts the resource demands from the jobSubmissionEvent. | [
"Extracts",
"the",
"resource",
"demands",
"from",
"the",
"jobSubmissionEvent",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/client/HDInsightJobSubmissionHandler.java#L139-L145 | train |
apache/reef | lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/client/HDInsightJobSubmissionHandler.java | HDInsightJobSubmissionHandler.getCommandList | private List<String> getCommandList(
final JobSubmissionEvent jobSubmissionEvent) {
return new JavaLaunchCommandBuilder()
.setJavaPath("%JAVA_HOME%/bin/java")
.setConfigurationFilePaths(Collections.singletonList(this.filenames.getDriverConfigurationPath()))
.setClassPath(this.classpat... | java | private List<String> getCommandList(
final JobSubmissionEvent jobSubmissionEvent) {
return new JavaLaunchCommandBuilder()
.setJavaPath("%JAVA_HOME%/bin/java")
.setConfigurationFilePaths(Collections.singletonList(this.filenames.getDriverConfigurationPath()))
.setClassPath(this.classpat... | [
"private",
"List",
"<",
"String",
">",
"getCommandList",
"(",
"final",
"JobSubmissionEvent",
"jobSubmissionEvent",
")",
"{",
"return",
"new",
"JavaLaunchCommandBuilder",
"(",
")",
".",
"setJavaPath",
"(",
"\"%JAVA_HOME%/bin/java\"",
")",
".",
"setConfigurationFilePaths"... | Assembles the command to execute the Driver in list form. | [
"Assembles",
"the",
"command",
"to",
"execute",
"the",
"Driver",
"in",
"list",
"form",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/client/HDInsightJobSubmissionHandler.java#L158-L169 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/examples/p2p/Pull2Push.java | Pull2Push.run | @Override
public void run() {
while (!this.closed) {
// Grab the next available message source, if any
final EventSource<T> nextSource = sources.poll();
if (null != nextSource) {
// Grab the next message from that source, if any
final T message = nextSource.getNext();
if... | java | @Override
public void run() {
while (!this.closed) {
// Grab the next available message source, if any
final EventSource<T> nextSource = sources.poll();
if (null != nextSource) {
// Grab the next message from that source, if any
final T message = nextSource.getNext();
if... | [
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"while",
"(",
"!",
"this",
".",
"closed",
")",
"{",
"// Grab the next available message source, if any",
"final",
"EventSource",
"<",
"T",
">",
"nextSource",
"=",
"sources",
".",
"poll",
"(",
")",
";",... | Executes the message loop. | [
"Executes",
"the",
"message",
"loop",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/examples/p2p/Pull2Push.java#L66-L87 | train |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/driver/CommunicationGroupDriverFactory.java | CommunicationGroupDriverFactory.getNewInstance | public CommunicationGroupDriver getNewInstance(
final Class<? extends Name<String>> groupName,
final Class<? extends Topology> topologyClass,
final int numberOfTasks,
final int customFanOut) throws InjectionException {
final Injector newInjector = injector.forkInjector();
newInjector.bi... | java | public CommunicationGroupDriver getNewInstance(
final Class<? extends Name<String>> groupName,
final Class<? extends Topology> topologyClass,
final int numberOfTasks,
final int customFanOut) throws InjectionException {
final Injector newInjector = injector.forkInjector();
newInjector.bi... | [
"public",
"CommunicationGroupDriver",
"getNewInstance",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Name",
"<",
"String",
">",
">",
"groupName",
",",
"final",
"Class",
"<",
"?",
"extends",
"Topology",
">",
"topologyClass",
",",
"final",
"int",
"numberOfTasks",
... | Instantiates a new CommunicationGroupDriver instance.
@param groupName specified name of the communication group
@param topologyClass topology implementation
@param numberOfTasks minimum number of tasks needed in this group before start
@param customFanOut fanOut for TreeTopology
@return CommunicationGroupDriver instan... | [
"Instantiates",
"a",
"new",
"CommunicationGroupDriver",
"instance",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/driver/CommunicationGroupDriverFactory.java#L76-L88 | train |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/data/output/OutputServiceTask.java | OutputServiceTask.call | @Override
public byte[] call(final byte[] memento) throws IOException {
try (final DataOutputStream outputStream = outputStreamProvider.create("hello")) {
outputStream.writeBytes("Hello REEF!");
}
return null;
} | java | @Override
public byte[] call(final byte[] memento) throws IOException {
try (final DataOutputStream outputStream = outputStreamProvider.create("hello")) {
outputStream.writeBytes("Hello REEF!");
}
return null;
} | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"call",
"(",
"final",
"byte",
"[",
"]",
"memento",
")",
"throws",
"IOException",
"{",
"try",
"(",
"final",
"DataOutputStream",
"outputStream",
"=",
"outputStreamProvider",
".",
"create",
"(",
"\"hello\"",
")",
")"... | Receives an output stream from the output service and writes "Hello REEF!" on it.
@param memento the memento objected passed down by the driver.
@return null
@throws java.io.IOException | [
"Receives",
"an",
"output",
"stream",
"from",
"the",
"output",
"service",
"and",
"writes",
"Hello",
"REEF!",
"on",
"it",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/data/output/OutputServiceTask.java#L57-L63 | train |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/suspend/Launch.java | Launch.main | public static void main(final String[] args) {
try {
final Configuration config = getClientConfiguration(args);
LOG.log(Level.INFO, "Configuration:\n--\n{0}--", Configurations.toString(config, true));
final Injector injector = Tang.Factory.getTang().newInjector(config);
final SuspendClient... | java | public static void main(final String[] args) {
try {
final Configuration config = getClientConfiguration(args);
LOG.log(Level.INFO, "Configuration:\n--\n{0}--", Configurations.toString(config, true));
final Injector injector = Tang.Factory.getTang().newInjector(config);
final SuspendClient... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"final",
"Configuration",
"config",
"=",
"getClientConfiguration",
"(",
"args",
")",
";",
"LOG",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
"\"Configurat... | Main method that runs the example.
@param args command line parameters. | [
"Main",
"method",
"that",
"runs",
"the",
"example",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/suspend/Launch.java#L125-L143 | train |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/HttpTrackingURLProvider.java | HttpTrackingURLProvider.getTrackingUrl | @Override
public String getTrackingUrl() {
if (this.httpServer == null) {
return "";
}
try {
return InetAddress.getLocalHost().getHostAddress() + ":" + httpServer.getPort();
} catch (final UnknownHostException e) {
LOG.log(Level.WARNING, "Cannot get host address.", e);
throw n... | java | @Override
public String getTrackingUrl() {
if (this.httpServer == null) {
return "";
}
try {
return InetAddress.getLocalHost().getHostAddress() + ":" + httpServer.getPort();
} catch (final UnknownHostException e) {
LOG.log(Level.WARNING, "Cannot get host address.", e);
throw n... | [
"@",
"Override",
"public",
"String",
"getTrackingUrl",
"(",
")",
"{",
"if",
"(",
"this",
".",
"httpServer",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"try",
"{",
"return",
"InetAddress",
".",
"getLocalHost",
"(",
")",
".",
"getHostAddress",
"("... | get tracking URI.
@return | [
"get",
"tracking",
"URI",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/HttpTrackingURLProvider.java#L59-L71 | train |
apache/reef | lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/HDICLI.java | HDICLI.kill | private void kill(final String applicationId) throws IOException {
LOG.log(Level.INFO, "Killing application [{0}]", applicationId);
this.hdInsightInstance.killApplication(applicationId);
} | java | private void kill(final String applicationId) throws IOException {
LOG.log(Level.INFO, "Killing application [{0}]", applicationId);
this.hdInsightInstance.killApplication(applicationId);
} | [
"private",
"void",
"kill",
"(",
"final",
"String",
"applicationId",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
"\"Killing application [{0}]\"",
",",
"applicationId",
")",
";",
"this",
".",
"hdInsightInstance",
".",
"k... | Kills the application with the given id.
@param applicationId
@throws IOException | [
"Kills",
"the",
"application",
"with",
"the",
"given",
"id",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/HDICLI.java#L113-L116 | train |
apache/reef | lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/HDICLI.java | HDICLI.logs | private void logs(final String applicationId) throws IOException {
LOG.log(Level.INFO, "Fetching logs for application [{0}]", applicationId);
this.logFetcher.fetch(applicationId, new OutputStreamWriter(System.out, StandardCharsets.UTF_8));
} | java | private void logs(final String applicationId) throws IOException {
LOG.log(Level.INFO, "Fetching logs for application [{0}]", applicationId);
this.logFetcher.fetch(applicationId, new OutputStreamWriter(System.out, StandardCharsets.UTF_8));
} | [
"private",
"void",
"logs",
"(",
"final",
"String",
"applicationId",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
"\"Fetching logs for application [{0}]\"",
",",
"applicationId",
")",
";",
"this",
".",
"logFetcher",
".",
... | Fetches the logs for the application with the given id and prints them to System.out.
@param applicationId
@throws IOException | [
"Fetches",
"the",
"logs",
"for",
"the",
"application",
"with",
"the",
"given",
"id",
"and",
"prints",
"them",
"to",
"System",
".",
"out",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/HDICLI.java#L124-L127 | train |
apache/reef | lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/HDICLI.java | HDICLI.logs | private void logs(final String applicationId, final File folder) throws IOException {
LOG.log(Level.FINE, "Fetching logs for application [{0}] and storing them in folder [{1}]",
new Object[]{applicationId, folder.getAbsolutePath()});
if (!folder.exists() && !folder.mkdirs()) {
LOG.log(Level.WARNIN... | java | private void logs(final String applicationId, final File folder) throws IOException {
LOG.log(Level.FINE, "Fetching logs for application [{0}] and storing them in folder [{1}]",
new Object[]{applicationId, folder.getAbsolutePath()});
if (!folder.exists() && !folder.mkdirs()) {
LOG.log(Level.WARNIN... | [
"private",
"void",
"logs",
"(",
"final",
"String",
"applicationId",
",",
"final",
"File",
"folder",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"Fetching logs for application [{0}] and storing them in folder [{1}]\"",
",",
... | Fetches the logs for the application with the given id and stores them in the given folder. One file per container.
@param applicationId
@param folder
@throws IOException | [
"Fetches",
"the",
"logs",
"for",
"the",
"application",
"with",
"the",
"given",
"id",
"and",
"stores",
"them",
"in",
"the",
"given",
"folder",
".",
"One",
"file",
"per",
"container",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/HDICLI.java#L136-L143 | train |
apache/reef | lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/HDICLI.java | HDICLI.list | private void list() throws IOException {
LOG.log(Level.FINE, "Listing applications");
final List<ApplicationState> applications = this.hdInsightInstance.listApplications();
for (final ApplicationState appState : applications) {
if (appState.getState().equals("RUNNING")) {
System.out.println(ap... | java | private void list() throws IOException {
LOG.log(Level.FINE, "Listing applications");
final List<ApplicationState> applications = this.hdInsightInstance.listApplications();
for (final ApplicationState appState : applications) {
if (appState.getState().equals("RUNNING")) {
System.out.println(ap... | [
"private",
"void",
"list",
"(",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINE",
",",
"\"Listing applications\"",
")",
";",
"final",
"List",
"<",
"ApplicationState",
">",
"applications",
"=",
"this",
".",
"hdInsightInstance",
... | Fetches a list of all running applications.
@throws IOException | [
"Fetches",
"a",
"list",
"of",
"all",
"running",
"applications",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-hdinsight/src/main/java/org/apache/reef/runtime/hdinsight/cli/HDICLI.java#L150-L158 | train |
apache/reef | lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/utils/DefinedRuntimesSerializer.java | DefinedRuntimesSerializer.toBytes | public byte[] toBytes(final DefinedRuntimes definedRuntimes){
final DatumWriter<DefinedRuntimes> configurationWriter =
new SpecificDatumWriter<>(DefinedRuntimes.class);
try (final ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final BinaryEncoder binaryEncoder = EncoderFactory.get(... | java | public byte[] toBytes(final DefinedRuntimes definedRuntimes){
final DatumWriter<DefinedRuntimes> configurationWriter =
new SpecificDatumWriter<>(DefinedRuntimes.class);
try (final ByteArrayOutputStream out = new ByteArrayOutputStream()) {
final BinaryEncoder binaryEncoder = EncoderFactory.get(... | [
"public",
"byte",
"[",
"]",
"toBytes",
"(",
"final",
"DefinedRuntimes",
"definedRuntimes",
")",
"{",
"final",
"DatumWriter",
"<",
"DefinedRuntimes",
">",
"configurationWriter",
"=",
"new",
"SpecificDatumWriter",
"<>",
"(",
"DefinedRuntimes",
".",
"class",
")",
";"... | Serializes DefinedRuntimes.
@param definedRuntimes the Avro object to toString
@return Serialized avro string | [
"Serializes",
"DefinedRuntimes",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-bridge-java/src/main/java/org/apache/reef/javabridge/utils/DefinedRuntimesSerializer.java#L44-L56 | train |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/ClassPathBuilder.java | ClassPathBuilder.couldBeYarnConfigurationPath | private static boolean couldBeYarnConfigurationPath(final String path) {
return path.contains("conf") ||
path.contains("etc") ||
path.contains(HadoopEnvironment.HADOOP_CONF_DIR);
} | java | private static boolean couldBeYarnConfigurationPath(final String path) {
return path.contains("conf") ||
path.contains("etc") ||
path.contains(HadoopEnvironment.HADOOP_CONF_DIR);
} | [
"private",
"static",
"boolean",
"couldBeYarnConfigurationPath",
"(",
"final",
"String",
"path",
")",
"{",
"return",
"path",
".",
"contains",
"(",
"\"conf\"",
")",
"||",
"path",
".",
"contains",
"(",
"\"etc\"",
")",
"||",
"path",
".",
"contains",
"(",
"Hadoop... | The oracle that tells us whether a given path could be a YARN configuration path.
@param path
@return | [
"The",
"oracle",
"that",
"tells",
"us",
"whether",
"a",
"given",
"path",
"could",
"be",
"a",
"YARN",
"configuration",
"path",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/ClassPathBuilder.java#L46-L50 | train |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/util/RemoteIdentifierParser.java | RemoteIdentifierParser.parseIp | public static String parseIp(final String remoteIdentifier) {
return remoteIdentifier.substring(PROTOCOL.length(), remoteIdentifier.lastIndexOf(':'));
} | java | public static String parseIp(final String remoteIdentifier) {
return remoteIdentifier.substring(PROTOCOL.length(), remoteIdentifier.lastIndexOf(':'));
} | [
"public",
"static",
"String",
"parseIp",
"(",
"final",
"String",
"remoteIdentifier",
")",
"{",
"return",
"remoteIdentifier",
".",
"substring",
"(",
"PROTOCOL",
".",
"length",
"(",
")",
",",
"remoteIdentifier",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
")",
";"... | Get the IP address from the remote identifier.
@param remoteIdentifier the remote identifier.
@return the IP address. | [
"Get",
"the",
"IP",
"address",
"from",
"the",
"remote",
"identifier",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/util/RemoteIdentifierParser.java#L36-L38 | train |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/client/AzureBatchJobSubmissionHandler.java | AzureBatchJobSubmissionHandler.onNext | @Override
public void onNext(final JobSubmissionEvent jobSubmissionEvent) {
LOG.log(Level.FINEST, "Submitting job: {0}", jobSubmissionEvent);
try {
this.applicationId = createApplicationId(jobSubmissionEvent);
final String folderName = this.azureBatchFileNames.getStorageJobFolder(this.application... | java | @Override
public void onNext(final JobSubmissionEvent jobSubmissionEvent) {
LOG.log(Level.FINEST, "Submitting job: {0}", jobSubmissionEvent);
try {
this.applicationId = createApplicationId(jobSubmissionEvent);
final String folderName = this.azureBatchFileNames.getStorageJobFolder(this.application... | [
"@",
"Override",
"public",
"void",
"onNext",
"(",
"final",
"JobSubmissionEvent",
"jobSubmissionEvent",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Submitting job: {0}\"",
",",
"jobSubmissionEvent",
")",
";",
"try",
"{",
"this",
".",
"appl... | Invoked when JobSubmissionEvent is triggered.
@param jobSubmissionEvent triggered job submission event. | [
"Invoked",
"when",
"JobSubmissionEvent",
"is",
"triggered",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/client/AzureBatchJobSubmissionHandler.java#L104-L138 | train |
apache/reef | lang/java/reef-examples/src/main/java/org/apache/reef/examples/distributedshell/ShellClient.java | ShellClient.main | public static void main(final String[] args) throws InjectionException, IOException {
final JavaConfigurationBuilder driverConfigBuilder = TANG.newConfigurationBuilder(STATIC_DRIVER_CONFIG);
new CommandLine(driverConfigBuilder)
.registerShortNameOfClass(Command.class)
.registerShortNameOfClass... | java | public static void main(final String[] args) throws InjectionException, IOException {
final JavaConfigurationBuilder driverConfigBuilder = TANG.newConfigurationBuilder(STATIC_DRIVER_CONFIG);
new CommandLine(driverConfigBuilder)
.registerShortNameOfClass(Command.class)
.registerShortNameOfClass... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"InjectionException",
",",
"IOException",
"{",
"final",
"JavaConfigurationBuilder",
"driverConfigBuilder",
"=",
"TANG",
".",
"newConfigurationBuilder",
"(",
"STATIC_DRIVER_CON... | Start the distributed shell job.
@param args command line parameters.
@throws InjectionException configuration error. | [
"Start",
"the",
"distributed",
"shell",
"job",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-examples/src/main/java/org/apache/reef/examples/distributedshell/ShellClient.java#L61-L101 | train |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/Containers.java | Containers.add | synchronized void add(final Container container) {
final String containerId = container.getId().toString();
if (this.hasContainer(containerId)) {
throw new RuntimeException("Trying to add a Container that is already known: " + containerId);
}
this.containers.put(containerId, container);
} | java | synchronized void add(final Container container) {
final String containerId = container.getId().toString();
if (this.hasContainer(containerId)) {
throw new RuntimeException("Trying to add a Container that is already known: " + containerId);
}
this.containers.put(containerId, container);
} | [
"synchronized",
"void",
"add",
"(",
"final",
"Container",
"container",
")",
"{",
"final",
"String",
"containerId",
"=",
"container",
".",
"getId",
"(",
")",
".",
"toString",
"(",
")",
";",
"if",
"(",
"this",
".",
"hasContainer",
"(",
"containerId",
")",
... | Registers the given container.
@param container
@throws java.lang.RuntimeException if a container with the same ID had been registered before. | [
"Registers",
"the",
"given",
"container",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/Containers.java#L63-L69 | train |
apache/reef | lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/Containers.java | Containers.removeAndGet | synchronized Container removeAndGet(final String containerId) {
final Container result = this.containers.remove(containerId);
if (null == result) {
throw new RuntimeException("Unknown container to remove: " + containerId);
}
return result;
} | java | synchronized Container removeAndGet(final String containerId) {
final Container result = this.containers.remove(containerId);
if (null == result) {
throw new RuntimeException("Unknown container to remove: " + containerId);
}
return result;
} | [
"synchronized",
"Container",
"removeAndGet",
"(",
"final",
"String",
"containerId",
")",
"{",
"final",
"Container",
"result",
"=",
"this",
".",
"containers",
".",
"remove",
"(",
"containerId",
")",
";",
"if",
"(",
"null",
"==",
"result",
")",
"{",
"throw",
... | Removes the container with the given ID.
@param containerId
@return the container that was registered before.
@throws java.lang.RuntimeException if no such container existed. | [
"Removes",
"the",
"container",
"with",
"the",
"given",
"ID",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-yarn/src/main/java/org/apache/reef/runtime/yarn/driver/Containers.java#L78-L84 | train |
apache/reef | lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/evaluator/EvaluatorShimLauncher.java | EvaluatorShimLauncher.main | public static void main(final String[] args) throws Exception {
LOG.log(Level.INFO, "Entering EvaluatorShimLauncher.main().");
final Injector injector = Tang.Factory.getTang().newInjector(parseCommandLine(args));
final EvaluatorShimLauncher launcher = injector.getInstance(EvaluatorShimLauncher.class);
... | java | public static void main(final String[] args) throws Exception {
LOG.log(Level.INFO, "Entering EvaluatorShimLauncher.main().");
final Injector injector = Tang.Factory.getTang().newInjector(parseCommandLine(args));
final EvaluatorShimLauncher launcher = injector.getInstance(EvaluatorShimLauncher.class);
... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"INFO",
",",
"\"Entering EvaluatorShimLauncher.main().\"",
")",
";",
"final",
"Injector",
"injector",
"=",
"T... | The starting point of the evaluator shim launcher. | [
"The",
"starting",
"point",
"of",
"the",
"evaluator",
"shim",
"launcher",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-azbatch/src/main/java/org/apache/reef/runtime/azbatch/evaluator/EvaluatorShimLauncher.java#L102-L108 | train |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/RemoteSenderEventHandler.java | RemoteSenderEventHandler.onNext | @Override
public void onNext(final RemoteEvent<T> value) {
try {
LOG.log(Level.FINEST, "Link: {0} event: {1}", new Object[] {linkRef, value});
if (linkRef.get() == null) {
queue.add(value);
final Link<byte[]> link = transport.get(value.remoteAddress());
if (link != null) {
... | java | @Override
public void onNext(final RemoteEvent<T> value) {
try {
LOG.log(Level.FINEST, "Link: {0} event: {1}", new Object[] {linkRef, value});
if (linkRef.get() == null) {
queue.add(value);
final Link<byte[]> link = transport.get(value.remoteAddress());
if (link != null) {
... | [
"@",
"Override",
"public",
"void",
"onNext",
"(",
"final",
"RemoteEvent",
"<",
"T",
">",
"value",
")",
"{",
"try",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"Link: {0} event: {1}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"linkRef",
","... | Handles the event to send to a remote node.
@param value the event
@throws RemoteRuntimeException | [
"Handles",
"the",
"event",
"to",
"send",
"to",
"a",
"remote",
"node",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/impl/RemoteSenderEventHandler.java#L93-L125 | train |
apache/reef | lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/task/OperatorTopologyStructImpl.java | OperatorTopologyStructImpl.recvFromChildren | @Override
public byte[] recvFromChildren() {
LOG.entering("OperatorTopologyStructImpl", "recvFromChildren", getQualifiedName());
for (final NodeStruct child : children) {
childrenToRcvFrom.add(child.getId());
}
byte[] retVal = new byte[0];
while (!childrenToRcvFrom.isEmpty()) {
LOG.fi... | java | @Override
public byte[] recvFromChildren() {
LOG.entering("OperatorTopologyStructImpl", "recvFromChildren", getQualifiedName());
for (final NodeStruct child : children) {
childrenToRcvFrom.add(child.getId());
}
byte[] retVal = new byte[0];
while (!childrenToRcvFrom.isEmpty()) {
LOG.fi... | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"recvFromChildren",
"(",
")",
"{",
"LOG",
".",
"entering",
"(",
"\"OperatorTopologyStructImpl\"",
",",
"\"recvFromChildren\"",
",",
"getQualifiedName",
"(",
")",
")",
";",
"for",
"(",
"final",
"NodeStruct",
"child",
... | Receive data from all children as a single byte array.
Messages from children are simply byte-concatenated.
This method is currently used only by the Gather operator.
@return gathered data as a byte array | [
"Receive",
"data",
"from",
"all",
"children",
"as",
"a",
"single",
"byte",
"array",
".",
"Messages",
"from",
"children",
"are",
"simply",
"byte",
"-",
"concatenated",
".",
"This",
"method",
"is",
"currently",
"used",
"only",
"by",
"the",
"Gather",
"operator"... | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-io/src/main/java/org/apache/reef/io/network/group/impl/task/OperatorTopologyStructImpl.java#L372-L394 | train |
apache/reef | lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeConfigurationBuilder.java | MultiRuntimeConfigurationBuilder.addRuntime | public MultiRuntimeConfigurationBuilder addRuntime(final String runtimeName) {
Validate.isTrue(SUPPORTED_RUNTIMES.contains(runtimeName), "unsupported runtime " + runtimeName);
this.runtimeNames.add(runtimeName);
return this;
} | java | public MultiRuntimeConfigurationBuilder addRuntime(final String runtimeName) {
Validate.isTrue(SUPPORTED_RUNTIMES.contains(runtimeName), "unsupported runtime " + runtimeName);
this.runtimeNames.add(runtimeName);
return this;
} | [
"public",
"MultiRuntimeConfigurationBuilder",
"addRuntime",
"(",
"final",
"String",
"runtimeName",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"SUPPORTED_RUNTIMES",
".",
"contains",
"(",
"runtimeName",
")",
",",
"\"unsupported runtime \"",
"+",
"runtimeName",
")",
";",
... | Adds runtime name to the builder.
@param runtimeName The name to add
@return The builder instance | [
"Adds",
"runtime",
"name",
"to",
"the",
"builder",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeConfigurationBuilder.java#L65-L70 | train |
apache/reef | lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeConfigurationBuilder.java | MultiRuntimeConfigurationBuilder.setDefaultRuntime | public MultiRuntimeConfigurationBuilder setDefaultRuntime(final String runtimeName) {
Validate.isTrue(SUPPORTED_RUNTIMES.contains(runtimeName), "Unsupported runtime " + runtimeName);
Validate.isTrue(!this.defaultRuntime.isPresent(), "Default runtime was already added");
this.defaultRuntime = Optional.of(ru... | java | public MultiRuntimeConfigurationBuilder setDefaultRuntime(final String runtimeName) {
Validate.isTrue(SUPPORTED_RUNTIMES.contains(runtimeName), "Unsupported runtime " + runtimeName);
Validate.isTrue(!this.defaultRuntime.isPresent(), "Default runtime was already added");
this.defaultRuntime = Optional.of(ru... | [
"public",
"MultiRuntimeConfigurationBuilder",
"setDefaultRuntime",
"(",
"final",
"String",
"runtimeName",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"SUPPORTED_RUNTIMES",
".",
"contains",
"(",
"runtimeName",
")",
",",
"\"Unsupported runtime \"",
"+",
"runtimeName",
")",
... | Sets default runtime. Default runtime is used when no runtime was specified for evaluator
@param runtimeName the default runtime name
@return The builder instance | [
"Sets",
"default",
"runtime",
".",
"Default",
"runtime",
"is",
"used",
"when",
"no",
"runtime",
"was",
"specified",
"for",
"evaluator"
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeConfigurationBuilder.java#L77-L83 | train |
apache/reef | lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeConfigurationBuilder.java | MultiRuntimeConfigurationBuilder.setSubmissionRuntime | public MultiRuntimeConfigurationBuilder setSubmissionRuntime(final String runtimeName) {
Validate.isTrue(
SUPPORTED_SUBMISSION_RUNTIMES.contains(runtimeName), "Unsupported submission runtime " +
runtimeName);
Validate.isTrue(this.submissionRuntime == null, "Submission runtime was already... | java | public MultiRuntimeConfigurationBuilder setSubmissionRuntime(final String runtimeName) {
Validate.isTrue(
SUPPORTED_SUBMISSION_RUNTIMES.contains(runtimeName), "Unsupported submission runtime " +
runtimeName);
Validate.isTrue(this.submissionRuntime == null, "Submission runtime was already... | [
"public",
"MultiRuntimeConfigurationBuilder",
"setSubmissionRuntime",
"(",
"final",
"String",
"runtimeName",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"SUPPORTED_SUBMISSION_RUNTIMES",
".",
"contains",
"(",
"runtimeName",
")",
",",
"\"Unsupported submission runtime \"",
"+",... | Sets the submission runtime. Submission runtime is used for launching the job driver.
@param runtimeName the submission runtime name
@return The builder instance | [
"Sets",
"the",
"submission",
"runtime",
".",
"Submission",
"runtime",
"is",
"used",
"for",
"launching",
"the",
"job",
"driver",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeConfigurationBuilder.java#L90-L98 | train |
apache/reef | lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeConfigurationBuilder.java | MultiRuntimeConfigurationBuilder.build | public Configuration build() {
Validate.notNull(this.submissionRuntime, "Default Runtime was not defined");
if(!this.defaultRuntime.isPresent() || this.runtimeNames.size() == 1){
this.defaultRuntime = Optional.of(this.runtimeNames.toArray(new String[0])[0]);
}
Validate.isTrue(this.defaultRuntime... | java | public Configuration build() {
Validate.notNull(this.submissionRuntime, "Default Runtime was not defined");
if(!this.defaultRuntime.isPresent() || this.runtimeNames.size() == 1){
this.defaultRuntime = Optional.of(this.runtimeNames.toArray(new String[0])[0]);
}
Validate.isTrue(this.defaultRuntime... | [
"public",
"Configuration",
"build",
"(",
")",
"{",
"Validate",
".",
"notNull",
"(",
"this",
".",
"submissionRuntime",
",",
"\"Default Runtime was not defined\"",
")",
";",
"if",
"(",
"!",
"this",
".",
"defaultRuntime",
".",
"isPresent",
"(",
")",
"||",
"this",... | Builds the configuration.
@return The built configuration | [
"Builds",
"the",
"configuration",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-runtime-multi/src/main/java/org/apache/reef/runtime/multi/client/MultiRuntimeConfigurationBuilder.java#L116-L154 | train |
apache/reef | lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/java/ClassHierarchyImpl.java | ClassHierarchyImpl.parseDefaultValue | @SuppressWarnings("unchecked")
@Override
public <T> T parseDefaultValue(final NamedParameterNode<T> name) {
final String[] vals = name.getDefaultInstanceAsStrings();
final T[] ret = (T[]) new Object[vals.length];
for (int i = 0; i < vals.length; i++) {
final String val = vals[i];
try {
... | java | @SuppressWarnings("unchecked")
@Override
public <T> T parseDefaultValue(final NamedParameterNode<T> name) {
final String[] vals = name.getDefaultInstanceAsStrings();
final T[] ret = (T[]) new Object[vals.length];
for (int i = 0; i < vals.length; i++) {
final String val = vals[i];
try {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"parseDefaultValue",
"(",
"final",
"NamedParameterNode",
"<",
"T",
">",
"name",
")",
"{",
"final",
"String",
"[",
"]",
"vals",
"=",
"name",
".",
"getDefaultI... | A helper method that returns the parsed default value of a given
NamedParameter.
@return null or an empty set if there is no default value, the default value (or set of values) otherwise.
@throws ClassHierarchyException if a default value was specified, but could not be parsed, or if a set of
values were specified for... | [
"A",
"helper",
"method",
"that",
"returns",
"the",
"parsed",
"default",
"value",
"of",
"a",
"given",
"NamedParameter",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/java/ClassHierarchyImpl.java#L107-L133 | train |
apache/reef | lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/java/ClassHierarchyImpl.java | ClassHierarchyImpl.classForName | @Override
public Class<?> classForName(final String name) throws ClassNotFoundException {
return ReflectionUtilities.classForName(name, loader);
} | java | @Override
public Class<?> classForName(final String name) throws ClassNotFoundException {
return ReflectionUtilities.classForName(name, loader);
} | [
"@",
"Override",
"public",
"Class",
"<",
"?",
">",
"classForName",
"(",
"final",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"ReflectionUtilities",
".",
"classForName",
"(",
"name",
",",
"loader",
")",
";",
"}"
] | Helper method that converts a String to a Class using this
ClassHierarchy's classloader. | [
"Helper",
"method",
"that",
"converts",
"a",
"String",
"to",
"a",
"Class",
"using",
"this",
"ClassHierarchy",
"s",
"classloader",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/java/ClassHierarchyImpl.java#L188-L191 | train |
apache/reef | lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/java/ClassHierarchyImpl.java | ClassHierarchyImpl.registerClass | @SuppressWarnings("unchecked")
private <T> Node registerClass(final Class<T> c)
throws ClassHierarchyException {
if (c.isArray()) {
throw new UnsupportedOperationException("Can't register array types");
}
try {
return getAlreadyBoundNode(c);
} catch (final NameResolutionException ign... | java | @SuppressWarnings("unchecked")
private <T> Node registerClass(final Class<T> c)
throws ClassHierarchyException {
if (c.isArray()) {
throw new UnsupportedOperationException("Can't register array types");
}
try {
return getAlreadyBoundNode(c);
} catch (final NameResolutionException ign... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"<",
"T",
">",
"Node",
"registerClass",
"(",
"final",
"Class",
"<",
"T",
">",
"c",
")",
"throws",
"ClassHierarchyException",
"{",
"if",
"(",
"c",
".",
"isArray",
"(",
")",
")",
"{",
"throw",
... | Assumes that all of the parents of c have been registered already.
@param c | [
"Assumes",
"that",
"all",
"of",
"the",
"parents",
"of",
"c",
"have",
"been",
"registered",
"already",
"."
] | e2c47121cde21108a602c560cf76565a40d0e916 | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/implementation/java/ClassHierarchyImpl.java#L376-L409 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.