{"id":49083277,"url":"https://github.com/teragrep/tmt_01","last_synced_at":"2026-04-20T14:01:36.937Z","repository":{"id":352612453,"uuid":"1193406591","full_name":"teragrep/tmt_01","owner":"teragrep","description":"Time-Partitioned Monoid Tree for Teragrep","archived":false,"fork":false,"pushed_at":"2026-04-20T12:09:52.000Z","size":37,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-20T12:37:30.291Z","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":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teragrep.png","metadata":{"files":{"readme":"README.adoc","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":"2026-03-27T07:28:16.000Z","updated_at":"2026-04-20T12:09:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/teragrep/tmt_01","commit_stats":null,"previous_names":["teragrep/tmt_01"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/teragrep/tmt_01","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Ftmt_01","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Ftmt_01/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Ftmt_01/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Ftmt_01/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teragrep","download_url":"https://codeload.github.com/teragrep/tmt_01/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teragrep%2Ftmt_01/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32050451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-04-20T14:01:05.441Z","updated_at":"2026-04-20T14:01:36.927Z","avatar_url":"https://github.com/teragrep.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n= Time-Partitioned Monoid Tree for Teragrep\n\nTime-Partitioned Monoid Tree for Teragrep is for constructing mathematical total sum of Teragrep Archive. The Monoid Tree constructs of https://www.rfc-editor.org/rfc/rfc9496.html[Ristretto255] sums of the tree leaves which then form up branch sums and totally a root sum. The Tree is implemented in immutable manner using copy-on-write to allow frozen snapshots of the tree state.\n\n== Features\n\n- Immutable via copy-on-write, each change produce a new copy of the tree.\n- Idempotent, changes are versioned and old versions are skipped.\n- Views are thread-safe. Writes too but versions need to be applied in order.\n- Null-free. Tree nodes initialize always into identity elements.\n\n\n== Documentation\n\nSee the official documentation on https://docs.teragrep.com[docs.teragrep.com].\n\n== Limitations\n\n- Tree is currently limited to Root-Year-Month-Day-Hour partitioning, however generalized implementation could be easily made that scales to desired precision.\n\n== How to [compile/use/implement]\n\n[source,java]\n----\npackage com.teragrep.tmt_01;\n\nimport com.goterl.lazysodium.LazySodiumJava;\nimport com.goterl.lazysodium.SodiumJava;\nimport com.goterl.lazysodium.interfaces.Ristretto255;\nimport com.teragrep.tmt_01.node.Root;\nimport org.junit.jupiter.api.Test;\n\nimport java.nio.charset.StandardCharsets;\nimport java.security.MessageDigest;\nimport java.security.NoSuchAlgorithmException;\nimport java.time.Instant;\nimport java.util.concurrent.atomic.AtomicReference;\n\npublic class ReadmeTest {\n\n    @Test\n    void main() throws NoSuchAlgorithmException {\n        // initialize first lazySodiumJava so we use only one instance\n        LazySodiumJava lazySodiumJava = new LazySodiumJava(new SodiumJava());\n\n        // our example payload to be ingested into the tree\n        RistrettoPoint pointDelta = bytesToPoint(lazySodiumJava, \"Hello World!\".getBytes(StandardCharsets.UTF_8));\n\n        Change change = new ChangeImpl(1L, Instant.EPOCH, pointDelta);\n\n        // identityElement that sums up to itself\n        RistrettoPoint identityElement = new LazysodiumRistrettoPoint(\n                lazySodiumJava,\n                new byte[Ristretto255.RISTRETTO255_BYTES]\n        );\n\n        // tree initialization\n        TimePartitionedMonoidTree tree = new TimePartitionedMonoidTreeImpl(identityElement);\n\n        // cause tree to process the change producing a new root, processChange returns a new root\n        Root newRoot = tree.processChange(change);\n\n        // new tree can be forked from an existing just as easily\n        TimePartitionedMonoidTree otherTree = new TimePartitionedMonoidTreeImpl(\n                identityElement,\n                new AtomicReference\u003c\u003e(newRoot)\n        );\n\n        otherTree.processChange(change);\n\n        // ... a forest?\n\n        // one can search delta between the trees by point() methods\n        RistrettoPoint hourPoint = tree.root().year(1970).month(0).day(0).hour(0).point();\n    }\n\n    private static RistrettoPoint bytesToPoint(LazySodiumJava lazySodiumJava, byte[] data)\n            throws NoSuchAlgorithmException {\n        MessageDigest digest = MessageDigest.getInstance(\"SHA-512\");\n        byte[] hash64 = digest.digest(data);\n        byte[] point = new byte[Ristretto255.RISTRETTO255_BYTES];\n        boolean success = lazySodiumJava.cryptoCoreRistretto255FromHash(point, hash64);\n        if (!success) {\n            throw new RuntimeException(\"Elligator 2 mapping failed\");\n        }\n        return new LazysodiumRistrettoPoint(lazySodiumJava, point);\n    }\n\n}\n\n----\n\n== Contributing\n\n// Change the repository name in the issues link to match with your project's name\n\nYou can involve yourself with our project by https://github.com/teragrep/repo-template/issues/new/choose[opening an issue] or submitting a pull request.\n\nContribution requirements:\n\n. *All changes must be accompanied by a new or changed test.* If you think testing is not required in your pull request, include a sufficient explanation as why you think so.\n. Security checks must pass\n. Pull requests must align with the principles and http://www.extremeprogramming.org/values.html[values] of extreme programming.\n. Pull requests must follow the principles of Object Thinking and Elegant Objects (EO).\n\nRead more in our https://github.com/teragrep/teragrep/blob/main/contributing.adoc[Contributing Guideline].\n\n=== Contributor License Agreement\n\nContributors must sign https://github.com/teragrep/teragrep/blob/main/cla.adoc[Teragrep Contributor License Agreement] before a pull request is accepted to organization's repositories.\n\nYou need to submit the CLA only once. After submitting the CLA you can contribute to all Teragrep's repositories.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Ftmt_01","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteragrep%2Ftmt_01","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteragrep%2Ftmt_01/lists"}