/** * Uploads data from the given byte array to the BLOB server in a content-addressable manner. * * @param value * the buffer to upload data from * @param offset * the read offset within the buffer * @param len * the number of bytes to upload from the buffer * @return the computed BLOB key identifying the BLOB on the server * @throws IOException * thrown if an I/O error occurs while uploading the data to the BLOB server */ public BlobKey put(byte[] value, int offset, int len) throws IOException { return putBuffer(null, null, value, offset, len); }
@Override public TransientBlobKey putTransient(byte[] value) throws IOException { try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putBuffer(null, value, 0, value.length, TRANSIENT_BLOB); } }
@Override public TransientBlobKey putTransient(byte[] value) throws IOException { try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putBuffer(null, value, 0, value.length, TRANSIENT_BLOB); } }
/** * Uploads data from the given byte array to the BLOB server and stores it under the given job ID and key. * * @param jobId * the job ID to identify the uploaded data * @param key * the key to identify the uploaded data * @param value * the buffer to upload data from * @param offset * the read offset within the buffer * @param len * the number of bytes to upload from the buffer * @throws IOException * thrown if an I/O error occurs while uploading the data to the BLOB server */ public void put(JobID jobId, String key, byte[] value, int offset, int len) throws IOException { if (key.length() > MAX_KEY_LENGTH) { throw new IllegalArgumentException("Keys must not be longer than " + MAX_KEY_LENGTH); } putBuffer(jobId, key, value, offset, len); }
@Override public TransientBlobKey putTransient(byte[] value) throws IOException { try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putBuffer(null, value, 0, value.length, TRANSIENT_BLOB); } }
@Override public TransientBlobKey putTransient(JobID jobId, byte[] value) throws IOException { checkNotNull(jobId); try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putBuffer(jobId, value, 0, value.length, TRANSIENT_BLOB); } }
@Override public TransientBlobKey putTransient(JobID jobId, byte[] value) throws IOException { checkNotNull(jobId); try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putBuffer(jobId, value, 0, value.length, TRANSIENT_BLOB); } }
@Override public TransientBlobKey putTransient(JobID jobId, byte[] value) throws IOException { checkNotNull(jobId); try (BlobClient bc = createClient()) { return (TransientBlobKey) bc.putBuffer(jobId, value, 0, value.length, TRANSIENT_BLOB); } }