{"id":37027841,"url":"https://github.com/gemfire/gemfire-distributed-types","last_synced_at":"2026-01-14T03:18:55.348Z","repository":{"id":250744263,"uuid":"801257019","full_name":"gemfire/gemfire-distributed-types","owner":"gemfire","description":"Distributed data type examples for GemFire","archived":false,"fork":false,"pushed_at":"2025-10-17T22:16:32.000Z","size":352,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-10-18T22:11:22.087Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gemfire.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-15T22:08:53.000Z","updated_at":"2025-10-17T22:16:36.000Z","dependencies_parsed_at":"2024-07-29T22:36:43.075Z","dependency_job_id":"81092461-61f2-4750-b6ad-7a995f468404","html_url":"https://github.com/gemfire/gemfire-distributed-types","commit_stats":null,"previous_names":["gemfire/gemfire-distributed-types"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/gemfire/gemfire-distributed-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-distributed-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-distributed-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-distributed-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-distributed-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gemfire","download_url":"https://codeload.github.com/gemfire/gemfire-distributed-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gemfire%2Fgemfire-distributed-types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T03:18:54.488Z","updated_at":"2026-01-14T03:18:55.319Z","avatar_url":"https://github.com/gemfire.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GemFire Distributed Types\n\n[![maven](https://img.shields.io/maven-central/v/dev.gemfire/gemfire-distributed-types)](https://central.sonatype.com/artifact/dev.gemfire/gemfire-distributed-types/overview)\n![build](https://github.com/gemfire/gemfire-distributed-types/actions/workflows/build.yaml/badge.svg)\n[![javadoc](https://javadoc.io/badge2/dev.gemfire/gemfire-distributed-types/javadoc.svg)](https://javadoc.io/doc/dev.gemfire/gemfire-distributed-types)\n\n### What is this?\n\nThis is a collection of various Java data types that are backed by GemFire, thus making them\nnaturally distributed and highly available.\n\nThese types are intended to be used from GemFire clients to provide concurrent and distributed\naccess.\n\n### Collection types\n\n- DSet\n- DList\n- DBlockingQueue\n- DCircularQueue\n\n### Concurrency types\n\n- DAtomicLong\n- DAtomicReference\n- DSemaphore\n- DCountDownLatch\n- DCounter\n\n### Other\n\n- DSnowflake\n\n### Examples\n\nAlmost all the types are created using a `DTypeFactory`:\n\n```java\nClientCache client = new ClientCacheFactory()\n    .addPoolLocator(\"localhost\", locatorPort)\n    .create();\n\nDTypeFactory factory = new DTypeFactory(client);\n\nDList\u003cString\u003e list = factory.createDList(\"myList\");\nDSet\u003cAccount\u003e accounts = factory.createDSet(\"accounts\");\nDSemaphore semaphore = factory.createDSemaphore(\"semaphore\", 1);\nDBlockingQueue queue = factory.createDQueue(\"queue\", 5);\nDCircularQueue circular = factory.createDCircularQueue(\"circular\", 100);\n```\n\n(`DSnowflake`s are simply created with regular Java instantiation)\n\n### Details\n\n`DSet`s and `DList`s implement the standard Java `Set` and `List` interfaces respectively.\n\n`DBlockingQueue` implements Java's `BlockingDeque` interface and provides a double-ended queue which\nprovides both head and tail semantics. Note that methods of this class that support timeouts, and\nare thus interruptible, can only be interrupted locally. The interrupt 'signal' is not passed on to\nthe cluster member that is actually performing the operation. This may lead to unexpected results if\nnot taken into account. For example, if we have a thread trying to take an entry:\n\n```java\nObject obj = queue.poll(10, TimeUnit.SECONDS);\n```\nIf this thread is interrupted, the thread executing on the server will continue. If, before the\ntimeout expires, another thread places an entry into the queue, the `poll`ing thread will retrieve\nit which may leave the queue in an unexpected state as far as the client is concerned. \n\n`DCircularQueue` implements the `Queue` interface and provides a first-in first-out queue with a\nfixed size that replaces its oldest element if full.\n\n`DSemaphore` provides an implementation with similar semantics to Java's `Semaphore` class.\nDSemaphores provide a concurrency type that can be used to co-ordinate between clients running on\ndifferent JVMs. Since DSemaphores are highly available, they maintain their state even when\nservers crash and clients re-connect to different servers.\n\n`DAtomicLong` provides a counter implementation similar to Java's `AtomicLong` class.\n\n`DAtomicReference` provides an implementation similar to Java's `AtomicReference` class. One\ndifference to note is that the `compareAndSet` method does not compare on object identity, but\nrather on object equality. This is because the identity on the client will obviously be different to\nthe identity on the server, where the operation is actually being performed. Hence the need to use\nequality as a way to compare objects.\n\n`DCountDownLatch` provides an implementation similar to Java's `CountDownLatch`.\n\n`DCounter` provides a counter that is a bit simpler than `DAtomicLong` but with better performance.\nThe current implementation utilizes GemFire's Delta interface in order to distribute updates to the\nvalue instead of the actual value. This approach avoids the need to ensure write ordering (always a\nproblem when updates are being generated across a distributed system).\n\n\u003e Note that any methods which can wait (and block) will automatically be retried if the server they\n\u003e are connected to crashes or stops. If the particular method semantics also provide a timeout, the\n\u003e timeout will be restarted.\n\n### Developing and Deploying\n\nThe package can easily be used from either Maven or Gradle:\n\n#### Maven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003edev.gemfire\u003c/groupId\u003e\n  \u003cartifactId\u003egemfire-distributed-types\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Gradle:\n```groovy\ndependencies {\n  implementation 'dev.gemfire:gemfire-distributed-types:0.1.4'\n}\n```\n\nIf necessary, instructions to access the dependent GemFire artifacts can be found here -\n[gemfire.dev](https://gemfire.dev/quickstart/java/)\n\nIn order to deploy the package to a GemFire cluster it should be added as an extension. The\nextension bundle can be found under [Releases](https://github.com/gemfire/gemfire-distributed-types/releases).\nThe `.gfm` file should be added to the `extensions` directory within the GemFire distribution. \nLook for a line in the logs that state `Initialized service for GemFire Distributed Types` to \nverify that the extension has been found and initialized.\n\n### Building\n\nBuilding artifacts locally is done using gradle. You will need to set the environment variables\n`COMMERCIAL_MAVEN_USERNAME` and `COMMERCIAL_MAVEN_PASSWORD` to the username and access token\nrequired by the Broadcom Maven repository:\n\n```shell\nexport COMMERCIAL_MAVEN_USERNAME=\u003cYOUR USERNAME\u003e\nexport COMMERCIAL_MAVEN_PASSWORD=\u003cACCESS TOKEN\u003e\n./gradlew publishToMavenLocal extensionDistZip\n```\n\nThis will also create the required `.gfm` file in `build/distributions/`.\n\n### Implementation details\n\nThese types are primarily implemented using a partitioned region and function calls. Operations are\ncaptured as lambdas and then routed to the server hosting the primary bucket for the given instance,\nwhere the operation is applied. Each collection implements GemFire's Delta interface which allows\nthe operation to be sent as a delta change to the secondary server.\n\nThe backing region is called `DTYPES`. It is a Partitioned Region with a redundancy of 1 (i.e.\nan additional copy of each structure is stored on a different server). Currently, this region is not\npersisted and is not user-configurable.\n\nDSemaphores are created with an implicit lease time which is periodically refreshed by a client\npinger thread. If the client crashes, or otherwise disconnects without releasing its permits, the\npermits, previously held by the client, will eventually be released. The default lease time for a\nsemaphore is 30 seconds. Clients ping servers every 10 seconds to indicate their aliveness. These\nvalues can be adjusted by setting the system properties `dtype.dsemaphore.pendingReleaseTime` and\n`dtype.client.pingIterval` respectively. Units are in milliseconds.\n\n### Looking for Support\n\nThis project is maintained by the VMware Tanzu GemFire R\u0026D team with help from the community. \nIf you need assistance, support is available with a licensed GemFire deployment. Visit \nhttps://www.broadcom.com/support for additional details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemfire%2Fgemfire-distributed-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgemfire%2Fgemfire-distributed-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgemfire%2Fgemfire-distributed-types/lists"}