From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- .../amazon/carbonado/raw/GenericStorableCodec.html | 702 +++++++++++++++++++++ 1 file changed, 702 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/raw/GenericStorableCodec.html (limited to 'apidocs/com/amazon/carbonado/raw/GenericStorableCodec.html') diff --git a/apidocs/com/amazon/carbonado/raw/GenericStorableCodec.html b/apidocs/com/amazon/carbonado/raw/GenericStorableCodec.html new file mode 100644 index 0000000..77cb1f3 --- /dev/null +++ b/apidocs/com/amazon/carbonado/raw/GenericStorableCodec.html @@ -0,0 +1,702 @@ + + + + + + +GenericStorableCodec (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.raw
+

Class GenericStorableCodec<S extends Storable>

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    StorableCodec<S>
    +
    +
    +
    +
    public class GenericStorableCodec<S extends Storable>
    +extends java.lang.Object
    +implements StorableCodec<S>
    +
    Generic codec that supports any kind of storable by auto-generating and + caching storable implementations.
    +
    Author:
    +
    Brian S O'Neill
    +
    See Also:
    GenericStorableCodecFactory
    +
  • +
+
+
+
    +
  • + + + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      voiddecode(S dest, + int generation, + byte[] data) +
      Used for decoding different generations of Storable.
      +
      byte[]encodePrimaryKey(java.lang.Object[] values) +
      Encode a key by extracting all the primary key properties from the given + storable.
      +
      byte[]encodePrimaryKey(java.lang.Object[] values, + int rangeStart, + int rangeEnd) +
      Encode a key by extracting all the primary key properties from the given + storable.
      +
      byte[]encodePrimaryKey(S storable) +
      Encode a key by extracting all the primary key properties from the given + storable.
      +
      byte[]encodePrimaryKey(S storable, + int rangeStart, + int rangeEnd) +
      Encode a key by extracting all the primary key properties from the given + storable.
      +
      byte[]encodePrimaryKeyPrefix() +
      Encode the primary key for when there are no values, but there may be a + prefix.
      +
      GenericStorableCodec.Decoder<S>getDecoder(int generation) +
      Deprecated.  +
      use direct decode method
      +
      +
      StorableIndex<S>getPrimaryKeyIndex() +
      Returns the sequence and directions of properties that make up the + primary key.
      +
      intgetPrimaryKeyPrefixLength() +
      Returns the number of prefix bytes in the primary key, which may be + zero.
      +
      GenericStorableCodec.SearchKeyFactory<S>getSearchKeyFactory(OrderedProperty<S>[] properties) +
      Returns a search key factory, which is useful for implementing indexes + and queries.
      +
      java.lang.Class<? extends S>getStorableClass() +
      Returns a concrete Storable implementation, which is fully + thread-safe.
      +
      java.lang.Class<S>getStorableType() +
      Returns the type of Storable that code is generated for.
      +
      RawSupport<S>getSupport() +
      Returns the default RawSupport object that is supplied to + Storable instances produced by this codec.
      +
      Sinstantiate() +
      Instantiate a Storable with no key or value defined yet.
      +
      Sinstantiate(byte[] key) +
      Instantiate a Storable with no value defined yet.
      +
      Sinstantiate(byte[] key, + byte[] value) +
      Instantiate a Storable with a specific key and value.
      +
      Sinstantiate(RawSupport<S> support) +
      Instantiate a Storable with no key or value defined yet.
      +
      Sinstantiate(RawSupport<S> support, + byte[] key, + byte[] value) +
      Instantiate a Storable with a specific key and value.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getStorableType

        +
        public final java.lang.Class<S> getStorableType()
        +
        Returns the type of Storable that code is generated for.
        +
        +
        Specified by:
        +
        getStorableType in interface StorableCodec<S extends Storable>
        +
        +
      • +
      + + + +
        +
      • +

        instantiate

        +
        public S instantiate()
        +
        Instantiate a Storable with no key or value defined yet. The default + RawSupport is supplied to the instance.
        +
        +
        Specified by:
        +
        instantiate in interface StorableCodec<S extends Storable>
        +
        Throws:
        +
        java.lang.IllegalStateException - if no default support exists
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        instantiate

        +
        public S instantiate(byte[] key)
        +                               throws FetchException
        +
        Instantiate a Storable with no value defined yet. The default RawSupport is supplied to the instance.
        +
        +
        Specified by:
        +
        instantiate in interface StorableCodec<S extends Storable>
        +
        Throws:
        +
        java.lang.IllegalStateException - if no default support exists
        +
        FetchException
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        instantiate

        +
        public S instantiate(byte[] key,
        +            byte[] value)
        +                               throws FetchException
        +
        Instantiate a Storable with a specific key and value. The default + RawSupport is supplied to the instance.
        +
        +
        Specified by:
        +
        instantiate in interface StorableCodec<S extends Storable>
        +
        Throws:
        +
        java.lang.IllegalStateException - if no default support exists
        +
        FetchException
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        instantiate

        +
        public S instantiate(RawSupport<S> support)
        +
        Instantiate a Storable with no key or value defined yet. Any + RawSupport can be supplied to the instance.
        +
        +
        Specified by:
        +
        instantiate in interface StorableCodec<S extends Storable>
        +
        Parameters:
        support - binds generated storable with a storage layer
        +
      • +
      + + + + + + + + + + + + + + + + + +
        +
      • +

        encodePrimaryKey

        +
        public byte[] encodePrimaryKey(S storable)
        +
        Description copied from interface: StorableCodec
        +
        Encode a key by extracting all the primary key properties from the given + storable.
        +
        +
        Specified by:
        +
        encodePrimaryKey in interface StorableCodec<S extends Storable>
        +
        Parameters:
        storable - extract primary key properties from this instance
        +
        Returns:
        raw search key
        +
      • +
      + + + + + +
        +
      • +

        encodePrimaryKey

        +
        public byte[] encodePrimaryKey(S storable,
        +                      int rangeStart,
        +                      int rangeEnd)
        +
        Description copied from interface: StorableCodec
        +
        Encode a key by extracting all the primary key properties from the given + storable.
        +
        +
        Specified by:
        +
        encodePrimaryKey in interface StorableCodec<S extends Storable>
        +
        Parameters:
        storable - extract primary key properties from this instance
        rangeStart - index of first property to use. Its value must be less + than the count of primary key properties.
        rangeEnd - index of last property to use, exlusive. Its value must + be less than or equal to the count of primary key properties.
        +
        Returns:
        raw search key
        +
      • +
      + + + +
        +
      • +

        encodePrimaryKey

        +
        public byte[] encodePrimaryKey(java.lang.Object[] values)
        +
        Description copied from interface: StorableCodec
        +
        Encode a key by extracting all the primary key properties from the given + storable.
        +
        +
        Specified by:
        +
        encodePrimaryKey in interface StorableCodec<S extends Storable>
        +
        Parameters:
        values - values to build into a key. It must be long enough to + accommodate all primary key properties.
        +
        Returns:
        raw search key
        +
      • +
      + + + +
        +
      • +

        encodePrimaryKey

        +
        public byte[] encodePrimaryKey(java.lang.Object[] values,
        +                      int rangeStart,
        +                      int rangeEnd)
        +
        Description copied from interface: StorableCodec
        +
        Encode a key by extracting all the primary key properties from the given + storable.
        +
        +
        Specified by:
        +
        encodePrimaryKey in interface StorableCodec<S extends Storable>
        +
        Parameters:
        values - values to build into a key. The length may be less than + the amount of primary key properties used by this factory. It must not + be less than the difference between rangeStart and rangeEnd.
        rangeStart - index of first property to use. Its value must be less + than the count of primary key properties.
        rangeEnd - index of last property to use, exlusive. Its value must + be less than or equal to the count of primary key properties.
        +
        Returns:
        raw search key
        +
      • +
      + + + +
        +
      • +

        encodePrimaryKeyPrefix

        +
        public byte[] encodePrimaryKeyPrefix()
        +
        Description copied from interface: StorableCodec
        +
        Encode the primary key for when there are no values, but there may be a + prefix. Returned value may be null if no prefix is defined.
        +
        +
        Specified by:
        +
        encodePrimaryKeyPrefix in interface StorableCodec<S extends Storable>
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getStorableClass

        +
        public java.lang.Class<? extends S> getStorableClass()
        +
        Returns a concrete Storable implementation, which is fully + thread-safe. It has two constructors defined: + +
        + public <init>(Storage, RawSupport);
        +
        + public <init>(Storage, RawSupport, byte[] key, byte[] value);
        + 
        + + Convenience methods are provided in this class to instantiate the + generated Storable.
        +
      • +
      + + + +
        +
      • +

        getSearchKeyFactory

        +
        public GenericStorableCodec.SearchKeyFactory<S> getSearchKeyFactory(OrderedProperty<S>[] properties)
        +
        Returns a search key factory, which is useful for implementing indexes + and queries.
        +
        Parameters:
        properties - properties to build the search key from
        +
      • +
      + + + + + +
        +
      • +

        decode

        +
        public void decode(S dest,
        +          int generation,
        +          byte[] data)
        +            throws CorruptEncodingException
        +
        Description copied from interface: StorableCodec
        +
        Used for decoding different generations of Storable. If layout + generations are not supported, simply throw a CorruptEncodingException.
        +
        +
        Specified by:
        +
        decode in interface StorableCodec<S extends Storable>
        +
        Parameters:
        dest - storable to receive decoded properties
        generation - storable layout generation number
        data - decoded into properties, some of which may be dropped if + destination storable doesn't have it
        +
        Throws:
        +
        CorruptEncodingException - if generation is unknown or if data cannot be decoded
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3