@Override public StreamingPropertyValueRef saveStreamingPropertyValue( ElementMutationBuilder elementMutationBuilder, String rowKey, Property property, StreamingPropertyValue streamingPropertyValue ) { try { HdfsLargeDataStore largeDataStore = new HdfsLargeDataStore(this.fileSystem, this.dataDir, rowKey, property); LimitOutputStream out = new LimitOutputStream(largeDataStore, maxStreamingPropertyValueTableDataSize); try { IOUtils.copy(streamingPropertyValue.getInputStream(), out); } finally { out.close(); } if (out.hasExceededSizeLimit()) { LOGGER.debug("saved large file to \"%s\" (length: %d)", largeDataStore.getFullHdfsPath(), out.getLength()); return new StreamingPropertyValueHdfsRef(largeDataStore.getRelativeFileName(), streamingPropertyValue); } else { return saveStreamingPropertyValueSmall(elementMutationBuilder, rowKey, property, out.getSmall(), streamingPropertyValue); } } catch (IOException ex) { throw new VertexiumException(ex); } }
@Override public StreamingPropertyValueRef saveStreamingPropertyValue( ElementMutationBuilder elementMutationBuilder, String rowKey, Property property, StreamingPropertyValue streamingPropertyValue ) { try { HdfsLargeDataStore largeDataStore = new HdfsLargeDataStore(this.fileSystem, this.dataDir, rowKey, property); LimitOutputStream out = new LimitOutputStream(largeDataStore, maxStreamingPropertyValueTableDataSize); try { IOUtils.copy(streamingPropertyValue.getInputStream(), out); } finally { out.close(); } if (out.hasExceededSizeLimit()) { LOGGER.debug("saved large file to \"%s\" (length: %d)", largeDataStore.getFullHdfsPath(), out.getLength()); return new StreamingPropertyValueHdfsRef(largeDataStore.getRelativeFileName(), streamingPropertyValue); } else { return saveStreamingPropertyValueSmall(elementMutationBuilder, rowKey, property, out.getSmall(), streamingPropertyValue); } } catch (IOException ex) { throw new VertexiumException(ex); } }