@Override public synchronized void reportServerInstability(String serverName) { if (connection.isConnected()) { try { handler.executeRequest(new ControllerInstabilityNotificationRequest(serverName), null); } catch (Exception e) { HostControllerLogger.ROOT_LOGGER.failedReportingServerInstabilityToMaster(e, serverName); } } }
@Override public synchronized void reportServerInstability(String serverName) { if (connection.isConnected()) { try { handler.executeRequest(new ControllerInstabilityNotificationRequest(serverName), null); } catch (Exception e) { HostControllerLogger.ROOT_LOGGER.failedReportingServerInstabilityToMaster(e, serverName); } } }
@Override public void close() throws IOException { synchronized (this) { try { if(isConnected()) { try { channelHandler.executeRequest(new UnregisterModelControllerRequest(), null).getResult().await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } finally { try { connectionManager.shutdown(); } finally { super.close(); } } } }
@Override public void close() throws IOException { try { if(prepareClose() && isConnected()) { try { channelHandler.executeRequest(new UnregisterModelControllerRequest(), null).getResult().await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } finally { try { super.close(); } finally { connectionManager.shutdown(); } } }
@Override public void close() throws IOException { try { if(prepareClose() && isConnected()) { try { channelHandler.executeRequest(new UnregisterModelControllerRequest(), null).getResult().await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } finally { try { super.close(); } finally { connectionManager.shutdown(); } } }
public File getFile(final String relativePath, final byte repoId, HostFileRepository localFileRepository) { if(connection.isConnected()) { try { return handler.executeRequest(new GetFileRequest(repoId, relativePath, localFileRepository), null).getResult().get(); } catch (Exception e) { throw MESSAGES.failedToGetFileFromRemoteRepository(e); } } else { return localFileRepository.getFile(relativePath); } } };
public File getFile(final String relativePath, final byte repoId, HostFileRepository localFileRepository) { if(connection.isConnected()) { try { return handler.executeRequest(new GetFileRequest(repoId, relativePath, localFileRepository), null).getResult().get(); } catch (Exception e) { throw HostControllerLogger.ROOT_LOGGER.failedToGetFileFromRemoteRepository(e); } } else { final File file = localFileRepository.getFile(relativePath); // using --cached-dc and the DC is unavailable, make sure the content exists locally. if (localHostInfo.isUsingCachedDc()) { if (! file.exists()) { throw HostControllerLogger.ROOT_LOGGER.failedToGetFileFromRemoteRepository(new RuntimeException("Content hash " + relativePath + " not found.")); } } return file; } } };
public File getFile(final String relativePath, final byte repoId, HostFileRepository localFileRepository) { if(connection.isConnected()) { try { return handler.executeRequest(new GetFileRequest(repoId, relativePath, localFileRepository), null).getResult().get(); } catch (Exception e) { throw HostControllerLogger.ROOT_LOGGER.failedToGetFileFromRemoteRepository(e); } } else { final File file = localFileRepository.getFile(relativePath); // using --cached-dc and the DC is unavailable, make sure the content exists locally. if (localHostInfo.isUsingCachedDc()) { if (! file.exists()) { throw HostControllerLogger.ROOT_LOGGER.failedToGetFileFromRemoteRepository(new RuntimeException("Content hash " + relativePath + " not found.")); } } return file; } } };
@Override public void run() { if (isConnected()) { boolean fail = false; AsyncFuture<Long> future = null;
@Override public void run() { if (isConnected()) { boolean fail = false; AsyncFuture<Long> future = null;
@Override public void run() { if (isConnected()) { boolean fail = false; AsyncFuture<Long> future = null;