public final class GryoPool extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GryoPool.Type |
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_IO_GRYO_POOL_SIZE |
static String |
CONFIG_IO_REGISTRY |
Constructor and Description |
---|
GryoPool(Configuration conf)
Create a pool of readers and writers from a
Configuration object. |
GryoPool(int poolSize,
GryoPool.Type type,
List<IoRegistry> registries)
Create a pool of a readers, writers or both of the specified size with an optional
IoRegistry object
which would allow custom serializers to be registered to the pool. |
Modifier and Type | Method and Description |
---|---|
<A> A |
doWithReader(Function<GryoReader,A> readerFunction) |
void |
doWithWriter(Consumer<GryoWriter> writerFunction) |
void |
offerReader(GryoReader gryoReader) |
void |
offerWriter(GryoWriter gryoWriter) |
GryoReader |
takeReader() |
GryoWriter |
takeWriter() |
public static final String CONFIG_IO_REGISTRY
public static final String CONFIG_IO_GRYO_POOL_SIZE
public GryoPool(Configuration conf)
Configuration
object. There are two configuration keys
expected: "gremlin.io.registry" which defines comma separated list of the fully qualified class names of
IoRegistry
implementations to use and the "gremlin.io.gryo.poolSize" which defines the initial size
of the GryoPool
. As with usage of GryoMapper.Builder.addRegistry(IoRegistry)
, the order in
which these items are added matters greatly. The order used for writing should be the order used for reading.public GryoPool(int poolSize, GryoPool.Type type, List<IoRegistry> registries)
IoRegistry
object
which would allow custom serializers to be registered to the pool.poolSize
- initial size of the pool.type
- the type of pool.registries
- a list of registries to assign to each GryoReader
and GryoWriter
instances.public GryoReader takeReader()
public GryoWriter takeWriter()
public void offerReader(GryoReader gryoReader)
public void offerWriter(GryoWriter gryoWriter)
public <A> A doWithReader(Function<GryoReader,A> readerFunction)
public void doWithWriter(Consumer<GryoWriter> writerFunction)
Copyright © 2013–2015 Apache Software Foundation. All rights reserved.