org.knime.core.data.container
Class NoKeyBuffer

java.lang.Object
  extended by org.knime.core.data.container.Buffer
      extended by org.knime.core.data.container.NoKeyBuffer
All Implemented Interfaces:
KNIMEStreamConstants

 class NoKeyBuffer
extends Buffer

Buffer implementation that does not write the row keys. Used to write data if only few columns have changed. This buffer writes the changed columns.

This class is used to save the data of the new columns in a RearrangeColumnsTable.

Author:
Bernd Wiswedel, University of Konstanz

Nested Class Summary
 
Nested classes/interfaces inherited from class org.knime.core.data.container.Buffer
Buffer.FromFileIterator
 
Field Summary
 
Fields inherited from class org.knime.core.data.container.Buffer
ZIP_ENTRY_BLOBS, ZIP_ENTRY_DATA, ZIP_ENTRY_META
 
Fields inherited from interface org.knime.core.data.container.KNIMEStreamConstants
BYTE_ROW_SEPARATOR, BYTE_TYPE_MISSING, BYTE_TYPE_SERIALIZATION, BYTE_TYPE_START, DUMMY_ROW_KEY, TC_ESCAPE, TC_TERMINATE
 
Constructor Summary
NoKeyBuffer(File binFile, File blobDir, DataTableSpec spec, InputStream metaIn, int bufferID, Map<Integer,ContainerTable> tblRep)
          Creates new buffer for reading.
NoKeyBuffer(int maxRowsInMemory, int bufferID, Map<Integer,ContainerTable> tblRep, Map<Integer,ContainerTable> localTblRep)
          Creates new buffer for writing.
 
Method Summary
(package private)  Buffer createLocalCloneForWriting()
          Creates a clone of this buffer for writing the content to a stream that is of the current version.
 String getVersion()
          Get the version string to write to the meta file.
(package private)  boolean shouldSkipRowKey()
          Get whether the buffer wants to persist row keys.
 int validateVersion(String version)
          Validate the version as read from the file if it can be parsed by this implementation.
 
Methods inherited from class org.knime.core.data.container.Buffer
addRow, addToZipFile, clear, clearIteratorInstance, close, containsBlobCells, createBlobDirNameForTemp, finalize, getBinFile, getBlobFile, getBufferID, getGlobalRepository, getLocalRepository, getReadVersion, getTableSpec, getTypeForChar, incrementSize, isBinFileGZipped, iterator, readBlobDataCell, restoreIntoMemory, size, usesOutFile, writeDataCell, writeRowKey
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoKeyBuffer

NoKeyBuffer(int maxRowsInMemory,
            int bufferID,
            Map<Integer,ContainerTable> tblRep,
            Map<Integer,ContainerTable> localTblRep)
Creates new buffer for writing.

Parameters:
maxRowsInMemory - Passed on to super.
bufferID - Passed on to super.
tblRep - Passed on to super.
localTblRep - Passed on to super.

NoKeyBuffer

NoKeyBuffer(File binFile,
            File blobDir,
            DataTableSpec spec,
            InputStream metaIn,
            int bufferID,
            Map<Integer,ContainerTable> tblRep)
      throws IOException
Creates new buffer for reading.

Parameters:
binFile - Passed on to super.
blobDir - Passed on to super.
spec - Passed on to super.
metaIn - Passed on to super.
bufferID - Passed on to super.
tblRep - Passed on to super.
Throws:
IOException - Passed on from super.
Method Detail

getVersion

public String getVersion()
Get the version string to write to the meta file. This method is overridden in the NoKeyBuffer to distinguish streams written by the different implementations.

Overrides:
getVersion in class Buffer
Returns:
The version string.

validateVersion

public int validateVersion(String version)
                    throws IOException
Validate the version as read from the file if it can be parsed by this implementation.

Overrides:
validateVersion in class Buffer
Parameters:
version - As read from file.
Returns:
The version ID for internal use.
Throws:
IOException - If it can't be parsed.

shouldSkipRowKey

boolean shouldSkipRowKey()
Get whether the buffer wants to persist row keys. Here hard-coded to true but overwritten in NoKeyBuffer.

Overrides:
shouldSkipRowKey in class Buffer
Returns:
whether row keys needs to be written/read.

createLocalCloneForWriting

Buffer createLocalCloneForWriting()
Creates a clone of this buffer for writing the content to a stream that is of the current version.

Overrides:
createLocalCloneForWriting in class Buffer
Returns:
A new buffer with the same ID, which is only used locally to update the stream.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.