Package dev.gemfire.dtype

GemFire Distributed Types

This is a collection of various Java data types that are backed by GemFire, thus making them naturally distributed and highly available.

The following types are provided

Distributed Type instances are created with a DTypeFactory. For example:

 ClientCache client = new ClientCacheFactory()
     .addPoolLocator("localhost", locatorPort)
     .create();

 DTypeFactory factory = new DTypeFactory(client);

 DList<String> list = factory.createDList("myList");
 DSet<Account> accounts = factory.createDSet("accounts");
 DSemaphore semaphore = factory.createDSemaphore("semaphore", 1);
 DBlockingQueue<String> queue = factory.createDQueue("queue", 5);
 DCircularQueue<Requests> queue = factory.createDCircularQueue("requests", 1000);
 
The various types are intended for use from GemFire clients and allow for concurrent and distributed access from clients running in different JVMs. Client structures hold almost no state and most all operations are performed on backend structures that are stored and managed by GemFire.

Note that iteration operations will serialize and retrieve the full structure to the client. Iteration is not performed remotely on the server. Only DList supports removal of elements when iterating.

Operations that take lambdas as arguments need to ensure that the lambda is also declared as Serializable. For example, the method removeIf(Predicate) could be used as:

   // DSet<Integer> set = ....
   set.removeIf((Predicate<Integer> & Serializable) x -> x % 2 == 0);
 
  • Interface Summary 
    Interface Description
    DAtomicLong
    A distributed and highly-available implementation of AtomicLongs.
    DAtomicReference<V>
    A distributed and highly-available implementation of AtomicReferences.
    DBlockingQueue<E>
    An implementation of a BlockingDeque that is distributed and highly available.
    DCircularQueue<E>
    An implementation of a Queue that provides a first-in first-out queue with a fixed size that replaces its oldest element if full.
    DCountDownLatch  
    DCounter
    A distributed type, similar to a DAtomicLong, but with higher throughput and less potential contention than DAtomicLong.
    DList<E>
    A DList is a distributed and highly available List that is backed by a GemFire cluster.
    DSemaphore
    DSemaphore is a highly-available, distributed version of the JDK's Semaphore.
    DSet<E>
    A DSet is a distributed and highly available Set that is backed by a GemFire cluster.
    DSnowflake
    DSnowflake is a cluster-unique ID generator based on the Twitter/X Snowflake design.
    DSnowflake.Builder
    Builder used to create custom DSnowflakes.
    DType
    Base interface for all Distributed Types
  • Class Summary 
    Class Description
    DTypeFactory
    The DTypeFactory is the primary means to access and create distributed types.
  • Exception Summary 
    Exception Description
    ClientDisconnectedException
    An exception that is thrown by the server to indicate that it 'seems' as though the client has disconnected.
    DTypeException
    General exception class for distributed types
    EntryDestroyedException
    An exception typically thrown when attempting to access an instance that has been destroyed.