try { while (!this.shutdownRequested.get()) { BlobServerConnection conn = new BlobServerConnection(serverSocket.accept(), this); try { synchronized (activeConnections) { conn.start(); conn = null; conn.close(); synchronized (activeConnections) { activeConnections.remove(conn);
/** * Closes the connection socket and lets the thread exit. */ public void close() { closeSilently(clientSocket, LOG); interrupt(); }
byte[] digest = readFileFully(inputStream, incomingFile, buf); LOG.error("PUT operation failed", t); try { writeErrorToStream(outputStream, t);
key = readKey(buf, inputStream); blobFile = blobServer.getStorageLocation(jobId, key); LOG.error("GET operation failed", t); try { writeErrorToStream(outputStream, t); LOG.error("GET operation failed", t); try { writeErrorToStream(outputStream, t);
/** * Creates a new BLOB connection for a client request. * * @param clientSocket The socket to read/write data. * @param blobServer The BLOB server. */ BlobServerConnection(Socket clientSocket, BlobServer blobServer) { super("BLOB connection for " + clientSocket.getRemoteSocketAddress()); setDaemon(true); this.clientSocket = clientSocket; this.blobServer = checkNotNull(blobServer); ReadWriteLock readWriteLock = blobServer.getReadWriteLock(); this.readLock = readWriteLock.readLock(); }
LOG.error("GET operation from {} failed.", clientSocket.getInetAddress(), t); try { writeErrorToStream(outputStream, t); blobKey, clientSocket.getInetAddress(), t); try { writeErrorToStream(outputStream, t); } catch (IOException e) {
byte[] digest = readFileFully(inputStream, incomingFile, buf); LOG.error("PUT operation failed", t); try { writeErrorToStream(outputStream, t);
JobID jobID = JobID.fromByteArray(jidBytes); String key = readKey(buf, inputStream); LOG.error("DELETE operation failed", t); try { writeErrorToStream(outputStream, t);
/** * Creates a new BLOB connection for a client request. * * @param clientSocket The socket to read/write data. * @param blobServer The BLOB server. */ BlobServerConnection(Socket clientSocket, BlobServer blobServer) { super("BLOB connection for " + clientSocket.getRemoteSocketAddress()); setDaemon(true); this.clientSocket = clientSocket; this.blobServer = checkNotNull(blobServer); ReadWriteLock readWriteLock = blobServer.getReadWriteLock(); this.readLock = readWriteLock.readLock(); }
LOG.error("GET operation from {} failed.", clientSocket.getInetAddress(), t); try { writeErrorToStream(outputStream, t); blobKey, clientSocket.getInetAddress(), t); try { writeErrorToStream(outputStream, t); } catch (IOException e) {
try { while (!this.shutdownRequested.get()) { BlobServerConnection conn = new BlobServerConnection(serverSocket.accept(), this); try { synchronized (activeConnections) { conn.start(); conn = null; conn.close(); synchronized (activeConnections) { activeConnections.remove(conn);
byte[] digest = readFileFully(inputStream, incomingFile, buf); LOG.error("PUT operation failed", t); try { writeErrorToStream(outputStream, t);
readFully(inputStream, jidBytes, 0, JobID.SIZE, "JobID"); jobID = JobID.fromByteArray(jidBytes); key = readKey(buf, inputStream); LOG.error("PUT operation failed", t); try { writeErrorToStream(outputStream, t);
/** * Closes the connection socket and lets the thread exit. */ public void close() { closeSilently(clientSocket, LOG); interrupt(); }