use of org.knime.core.data.filestore.FileStoreCell in project knime-core by knime.
the class Buffer method mustBeFlushedPriorSave.
private boolean mustBeFlushedPriorSave(final DataCell cell) {
if (cell instanceof FileStoreCell) {
FileStore fileStore = FileStoreUtil.getFileStore((FileStoreCell) cell);
return ((IWriteFileStoreHandler) m_fileStoreHandler).mustBeFlushedPriorSave(fileStore);
} else if (cell instanceof CollectionDataValue) {
for (DataCell c : (CollectionDataValue) cell) {
if (mustBeFlushedPriorSave(c)) {
return true;
}
}
} else if (cell instanceof BlobWrapperDataCell) {
final BlobWrapperDataCell blobWrapperCell = (BlobWrapperDataCell) cell;
Class<? extends BlobDataCell> blobClass = blobWrapperCell.getBlobClass();
if (CollectionDataValue.class.isAssignableFrom(blobClass)) {
return mustBeFlushedPriorSave(blobWrapperCell.getCell());
}
}
return false;
}
use of org.knime.core.data.filestore.FileStoreCell in project knime-core by knime.
the class AbstractTableStoreWriter method getFileStoreKeyAndFlush.
/**
* @param cell
* @return
* @throws IOException
*/
public FileStoreKey getFileStoreKeyAndFlush(final DataCell cell) throws IOException {
FileStoreKey fileStoreKey = null;
if (cell instanceof FileStoreCell) {
final FileStoreCell fsCell = (FileStoreCell) cell;
FileStore fileStore = FileStoreUtil.getFileStore(fsCell);
// TODO is the 'else' case realistic?
if (getFileStoreHandler() instanceof IWriteFileStoreHandler) {
fileStoreKey = getFileStoreHandler().translateToLocal(fileStore, fsCell);
} else {
// handler is not an IWriteFileStoreHandler but the buffer still contains file stores:
// the flow is part of a workflow and all file stores were already properly handled
// (this buffer is restored from disc - and then a memory alert forces the data back onto disc)
fileStoreKey = FileStoreUtil.getFileStoreKey(fileStore);
}
FileStoreUtil.invokeFlush(fsCell);
}
return fileStoreKey;
}
Aggregations