code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
@Override
public void onNext(final ResourceStatusEvent resourceStatusEvent) {
final String id = resourceStatusEvent.getIdentifier();
final Optional<EvaluatorManager> evaluatorManager = this.evaluators.get(id);
LOG.log(Level.FINEST, "Evaluator {0} status: {1}",
new Object[] {evaluatorManager, res... | java |
@Override
public byte[] encode(final NamingLookupResponse obj) {
final List<AvroNamingAssignment> assignments = new ArrayList<>(obj.getNameAssignments().size());
for (final NameAssignment nameAssignment : obj.getNameAssignments()) {
assignments.add(AvroNamingAssignment.newBuilder()
.setId(name... | java |
@Override
public NamingLookupResponse decode(final byte[] buf) {
final AvroNamingLookupResponse avroResponse = AvroUtils.fromBytes(buf, AvroNamingLookupResponse.class);
final List<NameAssignment> nas = new ArrayList<>(avroResponse.getTuples().size());
for (final AvroNamingAssignment tuple : avroResponse.g... | java |
public List<MonitorInfo> getMonitorLockedElements(final ThreadInfo threadInfo,
final StackTraceElement stackTraceElement) {
final Map<StackTraceElement, List<MonitorInfo>> elementMap = monitorLockedElements.get(threadInfo);
if (null == elementMap) {
retu... | java |
@Nullable
public String getWaitingLockString(final ThreadInfo threadInfo) {
if (null == threadInfo.getLockInfo()) {
return null;
} else {
return threadInfo.getLockName() + " held by " + threadInfo.getLockOwnerName();
}
} | java |
private static void storeCommandLineArgs(
final Configuration commandLineConf) throws InjectionException {
final Injector injector = Tang.Factory.getTang().newInjector(commandLineConf);
local = injector.getNamedInstance(Local.class);
dimensions = injector.getNamedInstance(ModelDimensions.class);
n... | java |
@Override
public byte[] encode(final T obj) {
final Encoder<T> encoder = (Encoder<T>) clazzToEncoderMap.get(obj.getClass());
if (encoder == null) {
throw new RemoteRuntimeException("Encoder for " + obj.getClass() + " not known.");
}
final WakeTuplePBuf.Builder tupleBuilder = WakeTuplePBuf.newBu... | java |
@Override
public byte[] encode(final NamingUnregisterRequest obj) {
final AvroNamingUnRegisterRequest result = AvroNamingUnRegisterRequest.newBuilder()
.setId(obj.getIdentifier().toString())
.build();
return AvroUtils.toBytes(result, AvroNamingUnRegisterRequest.class);
} | java |
@Override
public NamingUnregisterRequest decode(final byte[] buf) {
final AvroNamingUnRegisterRequest result = AvroUtils.fromBytes(buf, AvroNamingUnRegisterRequest.class);
return new NamingUnregisterRequest(factory.getNewInstance(result.getId().toString()));
} | java |
public synchronized void sendTaskStatus(final ReefServiceProtos.TaskStatusProto taskStatusProto) {
this.sendHeartBeat(this.getEvaluatorHeartbeatProto(
this.evaluatorRuntime.get().getEvaluatorStatus(),
this.contextManager.get().getContextStatusCollection(),
Optional.of(taskStatusProto)));
} | java |
public synchronized void sendContextStatus(
final ReefServiceProtos.ContextStatusProto contextStatusProto) {
// TODO[JIRA REEF-833]: Write a test that verifies correct order of heartbeats.
final Collection<ReefServiceProtos.ContextStatusProto> contextStatusList = new ArrayList<>();
contextStatusList.... | java |
public synchronized void sendEvaluatorStatus(
final ReefServiceProtos.EvaluatorStatusProto evaluatorStatusProto) {
this.sendHeartBeat(EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto.newBuilder()
.setTimestamp(System.currentTimeMillis())
.setEvaluatorStatus(evaluatorStatusProto)
.build... | java |
private synchronized void sendHeartBeat(
final EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto heartbeatProto) {
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(Level.FINEST, "Heartbeat message:\n" + heartbeatProto, new Exception("Stack trace"));
}
this.evaluatorHeartbeatHandler.onNext(heartbeatPro... | java |
private synchronized void initialize() {
if (this.runtimes != null) {
return;
}
this.runtimes = new HashMap<>();
for (final AvroRuntimeDefinition rd : runtimeDefinition.getRuntimes()) {
try {
// We need to create different injector for each runtime as they define conflicting bind... | java |
private void initializeInjector(final Injector runtimeInjector) throws InjectionException {
copyEventHandler(runtimeInjector, RuntimeParameters.ResourceStatusHandler.class);
copyEventHandler(runtimeInjector, RuntimeParameters.NodeDescriptorHandler.class);
copyEventHandler(runtimeInjector, RuntimeParameters... | java |
private Runtime getRuntime(final String requestedRuntimeName) {
final String runtimeName =
StringUtils.isBlank(requestedRuntimeName) ? this.defaultRuntimeName : requestedRuntimeName;
final Runtime runtime = this.runtimes.get(runtimeName);
Validate.notNull(runtime, "Couldn't find runtime for name "... | java |
public void advanceClock(final int offset) {
this.currentTime += offset;
final Iterator<Alarm> iter = this.alarmList.iterator();
while (iter.hasNext()) {
final Alarm alarm = iter.next();
if (alarm.getTimestamp() <= this.currentTime) {
alarm.run();
iter.remove();
}
}
} | java |
@Override
public byte[] call(final byte[] memento) {
LOG.log(Level.INFO, "RUN: command: {0}", this.command);
final String result = CommandUtils.runCommand(this.command);
LOG.log(Level.INFO, "RUN: result: {0}", result);
return CODEC.encode(result);
} | java |
public synchronized void send(final EvaluatorRuntimeProtocol.EvaluatorControlProto evaluatorControlProto) {
if (!this.wrapped.isPresent()) {
throw new IllegalStateException("Trying to send an EvaluatorControlProto before the Evaluator ID is set.");
}
if (!this.stateManager.isRunning()) {
LOG.log... | java |
synchronized void setRemoteID(final String evaluatorRID) {
if (this.wrapped.isPresent()) {
throw new IllegalStateException("Trying to reset the evaluator ID. This isn't supported.");
} else {
LOG.log(Level.FINE, "Registering remoteId [{0}] for Evaluator [{1}]", new Object[]{evaluatorRID, evaluatorId... | java |
private String convertTime(final long time) {
final Date date = new Date(time);
return FORMAT.format(date);
} | java |
public JobFolder createJobFolderWithApplicationId(final String applicationId) throws IOException {
final Path jobFolderPath = jobSubmissionDirectoryProvider.getJobSubmissionDirectoryPath(applicationId);
final String finalJobFolderPath = jobFolderPath.toString();
LOG.log(Level.FINE, "Final job submission Dir... | java |
public JobFolder createJobFolder(final String finalJobFolderPath) throws IOException {
LOG.log(Level.FINE, "Final job submission Directory: " + finalJobFolderPath);
return new JobFolder(this.fileSystem, new Path(finalJobFolderPath));
} | java |
@Override
public void onNext(final RemoteMessage<EvaluatorShimProtocol.EvaluatorShimControlProto> remoteMessage) {
final EvaluatorShimProtocol.EvaluatorShimCommand command = remoteMessage.getMessage().getCommand();
switch (command) {
case LAUNCH_EVALUATOR:
LOG.log(Level.INFO, "Received a command to ... | java |
@Override
public void unregister(final Identifier id) throws IOException {
final Link<NamingMessage> link = transport.open(serverSocketAddr, codec,
new LoggingLinkListener<NamingMessage>());
link.write(new NamingUnregisterRequest(id));
} | java |
public Path upload(final File localFile) throws IOException {
if (!localFile.exists()) {
throw new FileNotFoundException(localFile.getAbsolutePath());
}
final Path source = new Path(localFile.getAbsolutePath());
final Path destination = new Path(this.path, localFile.getName());
try {
... | java |
public LocalResource uploadAsLocalResource(final File localFile, final LocalResourceType type) throws IOException {
final Path remoteFile = upload(localFile);
return getLocalResourceForPath(remoteFile, type);
} | java |
@Override
public byte[] encode(final T obj) {
try (final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final ObjectOutputStream out = new ObjectOutputStream(bos)) {
out.writeObject(obj);
return bos.toByteArray();
} catch (final IOException ex) {
throw new RemoteRuntimeExc... | java |
@SuppressWarnings("unchecked")
@Override
public T decode(final byte[] buf) {
try (final ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buf))) {
return (T) in.readObject();
} catch (final ClassNotFoundException | IOException ex) {
throw new RemoteRuntimeException(ex);
}... | java |
public static void main(final String[] args)
throws InjectionException, IOException, ParseException {
final Configuration runtimeConfiguration =
YarnClientConfiguration.CONF.build();
runTaskScheduler(runtimeConfiguration, args);
} | java |
public static Set<String> getAllClasspathJars(final String... excludeEnv) {
final Set<String> jars = new HashSet<>();
final Set<Path> excludePaths = new HashSet<>();
for (final String env : excludeEnv) {
final String path = System.getenv(env);
if (null != path) {
final File file = new ... | java |
public synchronized void onPotentiallyIdle(final IdleMessage reason) {
final DriverStatusManager driverStatusManagerImpl = this.driverStatusManager.get();
if (driverStatusManagerImpl.isClosing()) {
LOG.log(IDLE_REASONS_LEVEL, "Ignoring idle call from [{0}] for reason [{1}]",
new Object[] {reas... | java |
public static void serialize(final File file, final ClassHierarchy classHierarchy) throws IOException {
final ClassHierarchyProto.Node node = serializeNode(classHierarchy.getNamespace());
try (final FileOutputStream output = new FileOutputStream(file)) {
try (final DataOutputStream dos = new DataOutputStr... | java |
@Override
public Optional<String> trySchedule(final Tasklet tasklet) {
for (int i = 0; i < idList.size(); i++) {
final int index = (nextIndex + i) % idList.size();
final String workerId = idList.get(index);
if (idLoadMap.get(workerId) < workerCapacity) {
nextIndex = (index + 1) % ... | java |
public static LauncherStatus launchLocal(final VortexJobConf vortexConf) {
final Configuration runtimeConf = LocalRuntimeConfiguration.CONF
.set(LocalRuntimeConfiguration.MAX_NUMBER_OF_EVALUATORS, MAX_NUMBER_OF_EVALUATORS)
.build();
return launch(runtimeConf, vortexConf.getConfiguration());
} | java |
@Override
public void handle(
final String target,
final HttpServletRequest request,
final HttpServletResponse response,
final int i)
throws IOException, ServletException {
LOG.log(Level.INFO, "JettyHandler handle is entered with target: {0} ", target);
final Request baseRequest... | java |
private HttpHandler validate(final HttpServletRequest request,
final HttpServletResponse response,
final ParsedHttpRequest parsedHttpRequest) throws IOException, ServletException {
final String specification = parsedHttpRequest.getTargetSpecification();
... | java |
private void writeMessage(final HttpServletResponse response, final String message, final int status)
throws IOException {
response.getWriter().println(message);
response.setStatus(status);
} | java |
final void addHandler(final HttpHandler handler) {
if (handler != null) {
if (!eventHandlers.containsKey(handler.getUriSpecification().toLowerCase())) {
eventHandlers.put(handler.getUriSpecification().toLowerCase(), handler);
} else {
LOG.log(Level.WARNING, "JettyHandler handle is alread... | java |
public void waitForCompletion() throws Exception {
LOG.info("Waiting for the Job Driver to complete.");
try {
synchronized (this) {
this.wait();
}
} catch (final InterruptedException ex) {
LOG.log(Level.WARNING, "Waiting for result interrupted.", ex);
}
this.reef.close();
... | java |
public <T> EventHandler<RemoteEvent<T>> getHandler() {
return new RemoteSenderEventHandler<T>(encoder, transport, executor);
} | java |
public URI uploadFile(final String jobFolder, final File file) throws IOException {
LOG.log(Level.INFO, "Uploading [{0}] to [{1}]", new Object[]{file, jobFolder});
try {
final CloudBlobClient cloudBlobClient = this.cloudBlobClientProvider.getCloudBlobClient();
final CloudBlobContainer container = ... | java |
private static ConfigurationModule addAll(final ConfigurationModule conf,
final OptionalParameter<String> param,
final File folder) {
ConfigurationModule result = conf;
final File[] files = folder.listFiles();
if (files ... | java |
@Override
public int getResubmissionAttempts() {
final String containerIdString = YarnUtilities.getContainerIdString();
final ApplicationAttemptId appAttemptID = YarnUtilities.getAppAttemptId(containerIdString);
if (containerIdString == null || appAttemptID == null) {
LOG.log(Level.WARNING, "Was no... | java |
private synchronized void initializeListOfPreviousContainers() {
if (this.previousContainers == null) {
final List<Container> yarnPrevContainers =
this.registration.getRegistration().getContainersFromPreviousAttempts();
// If it's still null, create an empty list to indicate that it's not a r... | java |
@Override
public void informAboutEvaluatorFailures(final Set<String> evaluatorIds) {
for (String evaluatorId : evaluatorIds) {
LOG.log(Level.WARNING, "Container [" + evaluatorId +
"] has failed during driver restart process, FailedEvaluatorHandler will be triggered, but " +
"no additiona... | java |
@Override
public void start(final VortexThreadPool vortexThreadPool) {
final VortexFuture future = vortexThreadPool.submit(new HelloVortexFunction(), null);
try {
future.get();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
} | java |
public synchronized EvaluatorContext getContext(final String contextId) {
for (final EvaluatorContext context : this.contextStack) {
if (context.getId().equals(contextId)) {
return context;
}
}
throw new RuntimeException("Unknown evaluator context " + contextId);
} | java |
public synchronized List<FailedContext> getFailedContextsForEvaluatorFailure() {
final List<FailedContext> failedContextList = new ArrayList<>();
final List<EvaluatorContext> activeContexts = new ArrayList<>(this.contextStack);
Collections.reverse(activeContexts);
for (final EvaluatorContext context : ... | java |
public synchronized void onContextStatusMessages(final Iterable<ContextStatusPOJO>
contextStatusPOJOs,
final boolean notifyClientOnNewActiveContext) {
for (final ContextStatusPOJO contextStatus : contextStatusP... | java |
private synchronized void onContextStatusMessage(final ContextStatusPOJO contextStatus,
final boolean notifyClientOnNewActiveContext) {
LOG.log(Level.FINER, "Processing context status message for context {0}", contextStatus.getContextId());
switch (contextStat... | java |
private synchronized void onContextReady(final ContextStatusPOJO contextStatus,
final boolean notifyClientOnNewActiveContext) {
assert ContextState.READY == contextStatus.getContextState();
final String contextID = contextStatus.getContextId();
// This could be the... | java |
private synchronized void onNewContext(final ContextStatusPOJO contextStatus,
final boolean notifyClientOnNewActiveContext) {
final String contextID = contextStatus.getContextId();
LOG.log(Level.FINE, "Adding new context {0}.", contextID);
final Optional<String> par... | java |
private synchronized void addContext(final EvaluatorContext context) {
this.contextStack.add(context);
this.contextIds.add(context.getId());
} | java |
private synchronized void removeContext(final EvaluatorContext context) {
this.contextStack.remove(context);
this.contextIds.remove(context.getId());
} | java |
public static void setLoggingLevel(final Level level) {
final Handler[] handlers = Logger.getLogger("").getHandlers();
ConsoleHandler ch = null;
for (final Handler h : handlers) {
if (h instanceof ConsoleHandler) {
ch = (ConsoleHandler) h;
break;
}
}
if (ch == null) {
... | java |
private EvaluatorManager getNewEvaluatorManagerInstance(final String id, final EvaluatorDescriptor desc) {
LOG.log(Level.FINEST, "Creating Evaluator Manager for Evaluator ID {0}", id);
final Injector child = this.injector.forkInjector();
try {
child.bindVolatileParameter(EvaluatorManager.EvaluatorIde... | java |
public EvaluatorManager getNewEvaluatorManagerForNewEvaluator(
final ResourceAllocationEvent resourceAllocationEvent) {
final EvaluatorManager evaluatorManager = getNewEvaluatorManagerInstanceForResource(resourceAllocationEvent);
evaluatorManager.fireEvaluatorAllocatedEvent();
return evaluatorManager... | java |
public EvaluatorManager getNewEvaluatorManagerForEvaluatorFailedDuringDriverRestart(
final ResourceStatusEvent resourceStatusEvent) {
return getNewEvaluatorManagerInstance(resourceStatusEvent.getIdentifier(),
this.evaluatorDescriptorBuilderFactory.newBuilder()
.setMemory(128)
.... | java |
public static String getGraphvizString(final Configuration config,
final boolean showImpl, final boolean showLegend) {
final GraphvizConfigVisitor visitor = new GraphvizConfigVisitor(config, showImpl, showLegend);
final Node root = config.getClassHierarchy().getNamespace... | java |
@Override
public boolean visit(final ClassNode<?> node) {
this.graphStr
.append(" ")
.append(node.getName())
.append(" [label=\"")
.append(node.getName())
.append("\", shape=box")
// .append(config.isSingleton(node) ? ", style=filled" : "")
.append("];\... | java |
@Override
public boolean visit(final PackageNode node) {
if (!node.getName().isEmpty()) {
this.graphStr
.append(" ")
.append(node.getName())
.append(" [label=\"")
.append(node.getFullName())
.append("\", shape=folder];\n");
}
return true;
} | java |
@Override
public boolean visit(final NamedParameterNode<?> node) {
this.graphStr
.append(" ")
.append(node.getName())
.append(" [label=\"")
.append(node.getSimpleArgName()) // parameter type, e.g. "Integer"
.append("\\n")
.append(node.getName()) ... | java |
@Override
public boolean visit(final Node nodeFrom, final Node nodeTo) {
if (!nodeFrom.getName().isEmpty()) {
this.graphStr
.append(" ")
.append(nodeFrom.getName())
.append(" -> ")
.append(nodeTo.getName())
.append(" [style=solid, dir=back, arrowtail=diamon... | java |
private void init(final Map<DistributedDataSetPartition, InputSplit[]> splitsPerPartition) {
final Pair<InputSplit[], DistributedDataSetPartition[]>
splitsAndPartitions = getSplitsAndPartitions(splitsPerPartition);
final InputSplit[] splits = splitsAndPartitions.getFirst();... | java |
protected NumberedSplit<InputSplit> allocateSplit(final String evaluatorId,
final BlockingQueue<NumberedSplit<InputSplit>> value) {
if (value == null) {
LOG.log(Level.FINE, "Queue of splits can't be empty. Returning null");
return null;
}
while (true) {
final NumberedSplit<InputSplit... | java |
@Override
public synchronized IdleMessage getIdleStatus() {
if (this.isIdle()) {
return IDLE_MESSAGE;
}
final String message = String.format(
"There are %d outstanding container requests and %d allocated containers",
this.outstandingContainerRequests, this.containerAllocationCount)... | java |
public static void main(final String[] args) throws InjectionException {
try (final REEFEnvironment reef = REEFEnvironment.fromConfiguration(
LOCAL_DRIVER_MODULE, DRIVER_CONFIG, ENVIRONMENT_CONFIG)) {
reef.run();
final ReefServiceProtos.JobStatusProto status = reef.getLastStatus();
LOG.lo... | java |
@Override
public byte[] encode(final RemoteEvent<T> obj) {
if (obj.getEvent() == null) {
throw new RemoteRuntimeException("Event is null");
}
final WakeMessagePBuf.Builder builder = WakeMessagePBuf.newBuilder();
builder.setSeq(obj.getSeq());
builder.setData(ByteString.copyFrom(encoder.encod... | java |
public static EvaluatorRequest fromString(final String serializedRequest) {
try {
final Decoder decoder =
DecoderFactory.get().jsonDecoder(AvroEvaluatorRequest.getClassSchema(), serializedRequest);
final SpecificDatumReader<AvroEvaluatorRequest> reader = new SpecificDatumReader<>(AvroEvaluator... | java |
@Override
public Void call(final Void input) throws Exception {
System.out.println("Hello, Vortex!");
return null;
} | java |
@Override
public Thread newThread(final Runnable r) {
final Thread t = new Thread(this.group, r,
String.format("%s:thread-%03d", this.prefix, this.threadNumber.getAndIncrement()), 0);
if (t.isDaemon()) {
t.setDaemon(false);
}
if (t.getPriority() != Thread.NORM_PRIORITY) {
t.setP... | java |
@Override
public Configuration getConfiguration() {
return Tang.Factory.getTang().newConfigurationBuilder()
.bindNamedParameter(TcpPortRangeBegin.class, String.valueOf(portRangeBegin))
.bindNamedParameter(TcpPortRangeCount.class, String.valueOf(portRangeCount))
.bindNamedParameter(TcpPortR... | java |
public synchronized void onInit() {
LOG.entering(CLASS_NAME, "onInit");
this.clientConnection.send(this.getInitMessage());
this.setStatus(DriverStatus.INIT);
LOG.exiting(CLASS_NAME, "onInit");
} | java |
public synchronized void onError(final Throwable exception) {
LOG.entering(CLASS_NAME, "onError", exception);
if (this.isClosing()) {
LOG.log(Level.WARNING, "Received an exception while already in shutdown.", exception);
} else {
LOG.log(Level.WARNING, "Shutting down the Driver with an excepti... | java |
public synchronized void onComplete() {
LOG.entering(CLASS_NAME, "onComplete");
if (this.isClosing()) {
LOG.log(Level.WARNING, "Ignoring second call to onComplete()",
new Exception("Dummy exception to get the call stack"));
} else {
LOG.log(Level.INFO, "Clean shutdown of the Driver.... | java |
private synchronized void setStatus(final DriverStatus toStatus) {
if (this.driverStatus.isLegalTransition(toStatus)) {
this.driverStatus = toStatus;
} else {
LOG.log(Level.WARNING, "Illegal state transition: {0} -> {1}", new Object[] {this.driverStatus, toStatus});
}
} | java |
@Override
public BatchCredentials getCredentials() {
final TokenCredentials tokenCredentials = new TokenCredentials(null, System.getenv(AZ_BATCH_AUTH_TOKEN_ENV));
return new BatchCredentials() {
@Override
public String baseUrl() {
return azureBatchAccountUri;
}
@Override
... | java |
<T> Link<NetworkConnectionServiceMessage<T>> openLink(
final Identifier connectionFactoryId, final Identifier remoteEndPointId) throws NetworkException {
final Identifier remoteId = getEndPointIdWithConnectionFactoryId(connectionFactoryId, remoteEndPointId);
try {
final SocketAddress address = nameR... | java |
@Override
public <T> ConnectionFactory<T> getConnectionFactory(final Identifier connFactoryId) {
final ConnectionFactory<T> connFactory = connFactoryMap.get(connFactoryId.toString());
if (connFactory == null) {
throw new RuntimeException("Cannot find ConnectionFactory of " + connFactoryId + ".");
}
... | java |
@Override
public <TInput, TOutput> VortexFuture<TOutput>
enqueueTasklet(final VortexFunction<TInput, TOutput> function, final TInput input,
final Optional<FutureCallback<TOutput>> callback) {
// TODO[REEF-500]: Simple duplicate Vortex Tasklet launch.
final VortexFuture<TOutput> vort... | java |
@Override
public <TInput, TOutput> VortexAggregateFuture<TInput, TOutput>
enqueueTasklets(final VortexAggregateFunction<TOutput> aggregateFunction,
final VortexFunction<TInput, TOutput> vortexFunction,
final VortexAggregatePolicy policy,
final Li... | java |
@Override
public void workerPreempted(final String id) {
final Optional<Collection<Tasklet>> preemptedTasklets = runningWorkers.removeWorker(id);
if (preemptedTasklets.isPresent()) {
for (final Tasklet tasklet : preemptedTasklets.get()) {
pendingTasklets.addFirst(tasklet);
}
}
} | java |
private synchronized void putDelegate(final List<Tasklet> tasklets, final VortexFutureDelegate delegate) {
for (final Tasklet tasklet : tasklets) {
taskletFutureMap.put(tasklet.getId(), delegate);
}
} | java |
private synchronized VortexFutureDelegate fetchDelegate(final List<Integer> taskletIds) {
VortexFutureDelegate delegate = null;
for (final int taskletId : taskletIds) {
final VortexFutureDelegate currDelegate = taskletFutureMap.remove(taskletId);
if (currDelegate == null) {
// TODO[JIRA REEF... | java |
private File makeGlobalJar() throws IOException {
final File jarFile = new File(this.fileNames.getGlobalFolderName() + this.fileNames.getJarFileSuffix());
new JARFileMaker(jarFile).addChildren(this.fileNames.getGlobalFolder()).close();
return jarFile;
} | java |
@SuppressWarnings("unchecked")
public static <T> T[] nullToEmpty(final T[] array) {
return array == null ? (T[])EMPTY_ARRAY : array;
} | java |
@Override
public void set(final String name, final UserCredentials other) throws IOException {
throw new RuntimeException("Not implemented! Attempt to set user " + name + " from: " + other);
} | java |
@Override
public Time scheduleAlarm(final int offset, final EventHandler<Alarm> handler) {
final Time alarm = new ClientAlarm(this.timer.getCurrent() + offset, handler);
if (LOG.isLoggable(Level.FINEST)) {
final int eventQueueLen;
synchronized (this.schedule) {
eventQueueLen = this.numC... | java |
@Override
public void stop(final Throwable exception) {
LOG.entering(CLASS_NAME, "stop");
synchronized (this.schedule) {
if (this.isClosed) {
LOG.log(Level.FINEST, "Clock has already been closed");
return;
}
this.isClosed = true;
this.exceptionCausedStop = exception... | java |
@Override
public void close() {
LOG.entering(CLASS_NAME, "close");
synchronized (this.schedule) {
if (this.isClosed) {
LOG.exiting(CLASS_NAME, "close", "Clock has already been closed");
return;
}
this.isClosed = true;
final Time stopEvent = new StopTime(Math.max(th... | java |
@SuppressWarnings("checkstyle:hiddenfield")
private <T extends Time> void subscribe(final Class<T> eventClass, final Set<EventHandler<T>> handlers) {
for (final EventHandler<T> handler : handlers) {
LOG.log(Level.FINEST, "Subscribe: event {0} handler {1}", new Object[] {eventClass.getName(), handler});
... | java |
void release(final String containerId) {
LOG.log(Level.FINE, "Release container: {0}", containerId);
final Container container = this.containers.removeAndGet(containerId);
this.resourceManager.releaseAssignedContainer(container.getId());
updateRuntimeStatus();
} | java |
void onStart() {
LOG.log(Level.FINEST, "YARN registration: begin");
this.nodeManager.init(this.yarnConf);
this.nodeManager.start();
try {
this.yarnProxyUser.doAs(
new PrivilegedExceptionAction<Object>() {
@Override
public Object run() throws Exception {
... | java |
void onStop(final Throwable exception) {
LOG.log(Level.FINE, "Stop Runtime: RM status {0}", this.resourceManager.getServiceState());
if (this.resourceManager.getServiceState() == Service.STATE.STARTED) {
// invariant: if RM is still running then we declare success.
try {
this.reefEventHa... | java |
private void onContainerStatus(final ContainerStatus value) {
final String containerId = value.getContainerId().toString();
final boolean hasContainer = this.containers.hasContainer(containerId);
if (hasContainer) {
LOG.log(Level.FINE, "Received container status: {0}", containerId);
final Res... | java |
private void handleNewContainer(final Container container) {
LOG.log(Level.FINE, "allocated container: id[ {0} ]", container.getId());
synchronized (this) {
if (!matchContainerWithPendingRequest(container)) {
LOG.log(Level.WARNING, "Got an extra container {0} that doesn't match, releasing...", ... | java |
private boolean matchContainerWithPendingRequest(final Container container) {
if (this.requestsAfterSentToRM.isEmpty()) {
return false;
}
final AMRMClient.ContainerRequest request = this.requestsAfterSentToRM.peek();
final boolean resourceCondition = container.getResource().getMemory() >= reque... | java |
private void updateRuntimeStatus() {
final RuntimeStatusEventImpl.Builder builder = RuntimeStatusEventImpl.newBuilder()
.setName(RUNTIME_NAME)
.setState(State.RUNNING)
.setOutstandingContainerRequests(this.containerRequestCounter.get());
for (final String allocatedContainerId : this.co... | java |
private void refreshEffectiveTopology() throws ParentDeadException {
LOG.entering("OperatorTopologyImpl", "refreshEffectiveTopology", getQualifiedName());
LOG.finest(getQualifiedName() + "Waiting to acquire topoLock");
synchronized (topologyLock) {
LOG.finest(getQualifiedName() + "Acquired topoLock");... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.