Class RowCache


  • final class RowCache
    extends java.lang.Object
    A Cache that stores rows retrieved from the server in result set's. This provides various mechanisms for determining the best rows to pick out that haven't been cached, etc.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  RowCache.CachedRow
      A cached row.
      private static class  RowCache.RowRef
      Used for the hash key in the cache.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Cache row_cache
      The actual cache that stores the rows.
    • Constructor Summary

      Constructors 
      Constructor Description
      RowCache​(int cache_size, int max_size)
      Constructs the cache.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void clear()
      Flushes the complete contents of the cache.
      (package private) java.util.Vector getResultPart​(java.util.Vector result_block, MConnection connection, int result_id, int row_index, int row_count, int col_count, int total_row_count)
      Requests a block of parts.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • row_cache

        private Cache row_cache
        The actual cache that stores the rows.
    • Constructor Detail

      • RowCache

        RowCache​(int cache_size,
                 int max_size)
        Constructs the cache.
        Parameters:
        cache_size - the number of elements in the row cache.
        max_size - the maximum size of the combined total of all items in the cache.
    • Method Detail

      • getResultPart

        java.util.Vector getResultPart​(java.util.Vector result_block,
                                       MConnection connection,
                                       int result_id,
                                       int row_index,
                                       int row_count,
                                       int col_count,
                                       int total_row_count)
                                throws java.io.IOException,
                                       java.sql.SQLException
        Requests a block of parts. If the block can be completely retrieved from the cache then it is done so. Otherwise, it forwards the request for the rows onto the connection object.
        Throws:
        java.io.IOException
        java.sql.SQLException
      • clear

        void clear()
        Flushes the complete contents of the cache.