Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.archive.crawler.frontier
Class RecyclingSerialBinding

    java.lang.Object
      com.sleepycat.bind.serial.SerialBase
          com.sleepycat.bind.serial.SerialBinding
              org.archive.crawler.frontier.RecyclingSerialBinding

All Implemented Interfaces:
  com.sleepycat.bind.EntryBinding

    public class RecyclingSerialBinding

extends com.sleepycat.bind.serial.SerialBinding

A SerialBinding that recycles a single FastOutputStream per thread, avoiding reallocation of the internal buffer for either repeated serializations or because of mid-serialization expansions. (Cached stream's buffer will quickly grow to a size sufficient for all serialized instances.)

Author:
  gojomo

Field Summary
`(package private) java.lang.ThreadLocal<com.sleepycat.util.FastOutputStream>` | `fastOutputStreamHolder` Thread-local cache of reusable FastOutputStream

Constructor Summary
`RecyclingSerialBinding(com.sleepycat.bind.serial.ClassCatalog classCatalog, java.lang.Class baseClass)` Constructor.

Method Summary
`void` | `objectToEntry(java.lang.Object object, com.sleepycat.je.DatabaseEntry entry)` Copies superclass simply to allow different source for FastOoutputStream.

Methods inherited from class com.sleepycat.bind.serial.SerialBinding
`entryToObject, getBaseClass, getClassLoader`

Methods inherited from class com.sleepycat.bind.serial.SerialBase
`getSerialBufferSize, getSerialOutput, setSerialBufferSize`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### fastOutputStreamHolder

    java.lang.ThreadLocal<com.sleepycat.util.FastOutputStream> fastOutputStreamHolder

  Thread-local cache of reusable FastOutputStream

Constructor Detail

### RecyclingSerialBinding

    public RecyclingSerialBinding(com.sleepycat.bind.serial.ClassCatalog classCatalog,
                                  java.lang.Class baseClass)

  Constructor. Save parameters locally, as superclass fields are private.

  Parameters:
    `classCatalog` - is the catalog to hold shared class information
    `baseClass` - is the base class for serialized objects stored using this binding

Method Detail

### objectToEntry

    public void objectToEntry(java.lang.Object object,
                              com.sleepycat.je.DatabaseEntry entry)

  Copies superclass simply to allow different source for FastOoutputStream.

  Specified by:
    `objectToEntry` in interface `com.sleepycat.bind.EntryBinding`
  Overrides:
    `objectToEntry` in class `com.sleepycat.bind.serial.SerialBinding`
  See Also:
    `SerialBinding.entryToObject(com.sleepycat.je.DatabaseEntry)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Internet Archive. All Rights Reserved.