@Override public DataRecord addRecord(InputStream stream) throws DataStoreException { try { return writeStream(stream, new BlobOptions()); } catch (IOException e) { throw new DataStoreException(e); } }
@Override public DataRecord addRecord(InputStream stream) throws DataStoreException { try { return writeStream(stream, new BlobOptions()); } catch (IOException e) { throw new DataStoreException(e); } }
@Override public DataRecord addRecord(InputStream stream) throws DataStoreException { try { return writeStream(stream, new BlobOptions()); } catch (IOException e) { throw new DataStoreException(e); } }
@Override public String writeBlob(InputStream stream, BlobOptions options) throws IOException { boolean threw = true; try { long start = System.nanoTime(); checkNotNull(stream); DataRecord dr = writeStream(stream, options); String id = getBlobId(dr); if (tracker != null && !InMemoryDataRecord.isInstance(id)) { try { tracker.add(id); log.trace("Tracked Id {}", id); } catch (Exception e) { log.warn("Could not add track id", e); } } threw = false; stats.uploaded(System.nanoTime() - start, TimeUnit.NANOSECONDS, dr.getLength()); stats.uploadCompleted(id); return id; } catch (DataStoreException e) { throw new IOException(e); } finally { //DataStore does not closes the stream internally //So close the stream explicitly Closeables.close(stream, threw); } }
@Override public String writeBlob(InputStream stream, BlobOptions options) throws IOException { boolean threw = true; try { long start = System.nanoTime(); checkNotNull(stream); DataRecord dr = writeStream(stream, options); String id = getBlobId(dr); if (tracker != null && !InMemoryDataRecord.isInstance(id)) { try { tracker.add(id); log.trace("Tracked Id {}", id); } catch (Exception e) { log.warn("Could not add track id", e); } } threw = false; stats.uploaded(System.nanoTime() - start, TimeUnit.NANOSECONDS, dr.getLength()); stats.uploadCompleted(id); return id; } catch (DataStoreException e) { throw new IOException(e); } finally { //DataStore does not closes the stream internally //So close the stream explicitly Closeables.close(stream, threw); } }
@Override public String writeBlob(InputStream stream, BlobOptions options) throws IOException { boolean threw = true; try { long start = System.nanoTime(); checkNotNull(stream); DataRecord dr = writeStream(stream, options); String id = getBlobId(dr); if (tracker != null && !InMemoryDataRecord.isInstance(id)) { try { tracker.add(id); log.trace("Tracked Id {}", id); } catch (Exception e) { log.warn("Could not add track id", e); } } threw = false; stats.uploaded(System.nanoTime() - start, TimeUnit.NANOSECONDS, dr.getLength()); stats.uploadCompleted(id); return id; } catch (DataStoreException e) { throw new IOException(e); } finally { //DataStore does not closes the stream internally //So close the stream explicitly Closeables.close(stream, threw); } }