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,
Optional<IoRegistry> ioRegistry)
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 a fully qualified class name of an IoRegistry
implementation and the "gremlin.io.gryo.poolSize" which defines the initial size of the GryoPool
.public GryoPool(int poolSize, GryoPool.Type type, Optional<IoRegistry> ioRegistry)
IoRegistry
object
which would allow custom serializers to be registered to the pool.poolSize
- initial size of the pool.type
- the type of pool.ioRegistry
- the registry 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.