{"id":16055281,"url":"https://github.com/balazskreith/vcollections","last_synced_at":"2025-04-05T08:13:13.075Z","repository":{"id":90683284,"uuid":"221672926","full_name":"balazskreith/vcollections","owner":"balazskreith","description":"Virtualised Collections ","archived":false,"fork":false,"pushed_at":"2020-08-14T12:00:51.000Z","size":486,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-10T15:50:34.020Z","etag":null,"topics":["collection","java","microservice"],"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/balazskreith.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2019-11-14T10:39:29.000Z","updated_at":"2020-05-18T07:13:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"8fb62d20-1f2f-4ec1-802e-40fe4e6f0ce2","html_url":"https://github.com/balazskreith/vcollections","commit_stats":{"total_commits":86,"total_committers":2,"mean_commits":43.0,"dds":0.4418604651162791,"last_synced_commit":"f955f53c260c1bc60cdae37d94108d0cb0f19e8f"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazskreith%2Fvcollections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazskreith%2Fvcollections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazskreith%2Fvcollections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balazskreith%2Fvcollections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balazskreith","download_url":"https://codeload.github.com/balazskreith/vcollections/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305946,"owners_count":20917208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["collection","java","microservice"],"created_at":"2024-10-09T02:07:30.239Z","updated_at":"2025-04-05T08:13:13.043Z","avatar_url":"https://github.com/balazskreith.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Virtualized Collections\n\nVirtualized collections decompose the representation \nof a collection from the space it is stored. The main goal of \nthis project is to provide a general library for collection interfaces\nbuilt in Java to store the corresponding data independently.\n\n## Quick Start\n\n### Install and Run\n\nThe packages for vcollections are stored in [jcenter](https://bintray.com/wobserver/vcollections/)\nTo include it in your project:\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.wobserver.vcollections\u003c/groupId\u003e\n  \u003cartifactId\u003evcollections-core\u003c/artifactId\u003e\n  \u003cversion\u003e0.2.3\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nOr in Gradle\n\n```\nimplementation 'com.wobserver.vcollections:vcollections-core:0.2.3'\n```\n\nAfter that you can create your own collections. In Java:\n\n```java\nIStorage\u003cLong, String\u003e storage = new MemoryStorage\u003c\u003e(new SequentialLongGenerator(), null, IStorage.NO_MAX_SIZE);\nList\u003cString\u003e list = new VArrayList(storage, Long.class);\n\n```\nHere you defined the storage with a sequential key \ngenerator (gives the next index every time we add a new item) \nand the collection separately, and the defined storage \n(memory in this case) \npassed as a parameters to VArrayList, the virtualized \nversion of the ArrayList.\n\n### Using Custom Storage\n\nLet's assume you decided to save contents in a file, instead of keeping it in the memory. \nThen you need to change the storage as follows:\n\n```java\nIStorage\u003cLong, String\u003e storage = new FileStorage(\n  PrimitiveTypesMapperFactory.make(Long.class, String.class), // mapper for keys\n  String.class, // type of values\n  new ObjectMapper(), // mapper for values\n  \"temp/\",  // path of directory key, values are stored\n  new SequentialLongGenerator(),  // a generator of keys for create operation\n  IStorage.NO_MAX_SIZE // indicate the capacity of this storage in a number of elemenets\n);\n```\nHere you defined a file storage for any VCollection. \nFor the file storage you need to define a mapper \nbetween a the filename and your key type (Long in this case), \ndefine the type of value (String in this case), \nthe ObjectMapper capable of mapping your type of value, \nthe path of the directory you want to save the file, \na generator of unique keys for create operations, \nand the capacity of your storage.\n\n\nA Storage can be virtualized too! Let's say you realize your storage is slow, \nso you want to introduce some cache. You need to change the storage as follows:\n\n```java\nIStorage\u003cLong, String\u003e superset = new FileStorage(...)\nIStorage\u003cLong, String\u003e subset = new MemoryStorage\u003c\u003e(new SequentialLongGenerator(), null, IStorage.NO_MAX_SIZE);;\nIStorage\u003cLong, String\u003e storage = new CachedStorage(Long.class, subset, superset);\n```\n\n\n### Configure externally\n\nYou can make a yaml, or json file with this parameter and provide a builder \nfor this storage. \n\n```yaml\nstorageProfiles:\n  myCachedStorageProfile:\n    builder: CachedStorageBuilder\n    configuration:\n      superset:\n        builder: FileStorageBuilder\n        configuration:\n          valueType: java.lang.String\n          keyType: java.lang.Long    \n          path: \"temp/\"\n      subset:\n        builder: MemoryStorageBuilder\n        configuration:\n          capacity: 10\n```\n\nTo use your configuration type:\n\n```java\nStorageProvider storageProvider = new StorageProvider().withYamlFile(\"myYamlFile\");\nIStorage\u003cLong, String\u003e customers = storageProvider.getStorageFor(\"myFileStorargeProfileName\");\n``` \n\n\nFor further possibility please read gthe [Developers Manual](docs/Manual.md). \n\n## License\n\nBefore you include this library into your production, \nplease read the [license](LICENSE.md).\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalazskreith%2Fvcollections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalazskreith%2Fvcollections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalazskreith%2Fvcollections/lists"}