Search in sources :

Example 6 with IWriteFileStoreHandler

use of org.knime.core.data.filestore.internal.IWriteFileStoreHandler 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;
}
Also used : FileStore(org.knime.core.data.filestore.FileStore) IWriteFileStoreHandler(org.knime.core.data.filestore.internal.IWriteFileStoreHandler) FileStoreKey(org.knime.core.data.filestore.FileStoreKey) FileStoreCell(org.knime.core.data.filestore.FileStoreCell)

Aggregations

IWriteFileStoreHandler (org.knime.core.data.filestore.internal.IWriteFileStoreHandler)6 FileStore (org.knime.core.data.filestore.FileStore)2 FileStoreCell (org.knime.core.data.filestore.FileStoreCell)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 DataCell (org.knime.core.data.DataCell)1 CollectionDataValue (org.knime.core.data.collection.CollectionDataValue)1 FileStoreKey (org.knime.core.data.filestore.FileStoreKey)1 IFileStoreHandler (org.knime.core.data.filestore.internal.IFileStoreHandler)1 ILoopStartWriteFileStoreHandler (org.knime.core.data.filestore.internal.ILoopStartWriteFileStoreHandler)1 LoopEndWriteFileStoreHandler (org.knime.core.data.filestore.internal.LoopEndWriteFileStoreHandler)1 LoopStartReferenceWriteFileStoreHandler (org.knime.core.data.filestore.internal.LoopStartReferenceWriteFileStoreHandler)1 LoopStartWritableFileStoreHandler (org.knime.core.data.filestore.internal.LoopStartWritableFileStoreHandler)1 ReferenceWriteFileStoreHandler (org.knime.core.data.filestore.internal.ReferenceWriteFileStoreHandler)1 WriteFileStoreHandler (org.knime.core.data.filestore.internal.WriteFileStoreHandler)1 ThreadNodeExecutionJobManager (org.knime.core.node.exec.ThreadNodeExecutionJobManager)1