Showing preview only (2,046K chars total). Download the full file or copy to clipboard to get everything.
Repository: lambdazen/bitsy
Branch: master
Commit: 4d76489ad8d9
Files: 194
Total size: 1.9 MB
Directory structure:
gitextract_xh4rv3j8/
├── .classpath
├── .git-blame-ignore-revs
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── .mvn/
│ └── wrapper/
│ └── maven-wrapper.properties
├── .project
├── .settings/
│ └── org.eclipse.jdt.core.prefs
├── LICENSE
├── NOTICE
├── README.md
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src/
├── main/
│ ├── java/
│ │ └── com/
│ │ └── lambdazen/
│ │ └── bitsy/
│ │ ├── BitsyEdge.java
│ │ ├── BitsyElement.java
│ │ ├── BitsyErrorCodes.java
│ │ ├── BitsyException.java
│ │ ├── BitsyFeatures.java
│ │ ├── BitsyGraph.java
│ │ ├── BitsyGraphMBean.java
│ │ ├── BitsyGraphSONModule.java
│ │ ├── BitsyIoRegistryV3d0.java
│ │ ├── BitsyIsolationLevel.java
│ │ ├── BitsyProperty.java
│ │ ├── BitsyRetryException.java
│ │ ├── BitsyState.java
│ │ ├── BitsyVertex.java
│ │ ├── BitsyVertexProperty.java
│ │ ├── ICommitChanges.java
│ │ ├── IEdge.java
│ │ ├── IGraphStore.java
│ │ ├── ITransaction.java
│ │ ├── PortDatabase.java
│ │ ├── ThreadedBitsyGraph.java
│ │ ├── UUID.java
│ │ ├── UUIDGraphBinarySerializer.java
│ │ ├── ads/
│ │ │ ├── dict/
│ │ │ │ ├── Dictionary.java
│ │ │ │ ├── Dictionary1.java
│ │ │ │ ├── Dictionary11.java
│ │ │ │ ├── Dictionary16.java
│ │ │ │ ├── Dictionary2.java
│ │ │ │ ├── Dictionary3.java
│ │ │ │ ├── Dictionary4.java
│ │ │ │ ├── Dictionary6.java
│ │ │ │ ├── Dictionary8.java
│ │ │ │ ├── DictionaryFactory.java
│ │ │ │ ├── DictionaryMax.java
│ │ │ │ └── PrimitiveDictionary.java
│ │ │ └── set/
│ │ │ ├── ArraySet.java
│ │ │ ├── ClassifierGetter.java
│ │ │ ├── CompactMultiSetMax.java
│ │ │ ├── CompactSet.java
│ │ │ ├── PrimitiveSet.java
│ │ │ ├── Set.java
│ │ │ ├── Set12.java
│ │ │ ├── Set2.java
│ │ │ ├── Set24.java
│ │ │ ├── Set3.java
│ │ │ ├── Set4.java
│ │ │ ├── Set6.java
│ │ │ ├── Set8.java
│ │ │ └── SetMax.java
│ │ ├── gremlin/
│ │ │ ├── BitsyGraphStep.java
│ │ │ └── BitsyTraversalStrategy.java
│ │ ├── index/
│ │ │ ├── BitsyIndex.java
│ │ │ ├── BitsyIndexMap.java
│ │ │ ├── EdgeIndex.java
│ │ │ ├── EdgeIndexMap.java
│ │ │ ├── IndexHelper.java
│ │ │ ├── VertexIndex.java
│ │ │ └── VertexIndexMap.java
│ │ ├── jsr223/
│ │ │ └── BitsyGremlinPlugin.java
│ │ ├── store/
│ │ │ ├── AdjacencyMap.java
│ │ │ ├── AdjacencyMapForBeans.java
│ │ │ ├── BackupJob.java
│ │ │ ├── CompactAndCopyTask.java
│ │ │ ├── EdgeBean.java
│ │ │ ├── EdgeBeanJson.java
│ │ │ ├── Endpoint.java
│ │ │ ├── FileBackedMemoryGraphStore.java
│ │ │ ├── IEdgeRemover.java
│ │ │ ├── IStringCanonicalizer.java
│ │ │ ├── ITxBatchJob.java
│ │ │ ├── IVeReorgJob.java
│ │ │ ├── IndexBean.java
│ │ │ ├── JobWithCountDownLatch.java
│ │ │ ├── LoadTask.java
│ │ │ ├── MemoryGraphStore.java
│ │ │ ├── ParallelRecordReader.java
│ │ │ ├── Record.java
│ │ │ ├── RecordReader.java
│ │ │ ├── SingleThreadedStringCanonicalizer.java
│ │ │ ├── TxBatch.java
│ │ │ ├── TxLog.java
│ │ │ ├── TxLogFlushPotential.java
│ │ │ ├── TxUnit.java
│ │ │ ├── VEObsolescencePotential.java
│ │ │ ├── VertexBean.java
│ │ │ └── VertexBeanJson.java
│ │ ├── tx/
│ │ │ ├── BitsyTransaction.java
│ │ │ └── BitsyTransactionContext.java
│ │ ├── util/
│ │ │ ├── BitsyElementIterator.java
│ │ │ ├── BufferFlusher.java
│ │ │ ├── BufferPotential.java
│ │ │ ├── BufferQueuer.java
│ │ │ ├── CommittableFileLog.java
│ │ │ ├── DefaultCommitChanges.java
│ │ │ ├── DoubleBuffer.java
│ │ │ ├── DoubleBufferThread.java
│ │ │ ├── DoubleBufferWithExecWork.java
│ │ │ ├── EdgeIterator.java
│ │ │ └── VertexIterator.java
│ │ └── wrapper/
│ │ ├── BitsyAutoReloadingEdge.java
│ │ ├── BitsyAutoReloadingGraph.java
│ │ └── BitsyAutoReloadingVertex.java
│ └── resources/
│ └── META-INF/
│ └── services/
│ └── org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
└── test/
├── java/
│ └── com/
│ └── lambdazen/
│ └── bitsy/
│ ├── BitsyGraphIT.java
│ ├── BitsyMemGraphIT.java
│ ├── FileBasedTestCase.java
│ ├── RecoveryTest.java
│ ├── ads/
│ │ ├── dict/
│ │ │ └── DictionaryTest.java
│ │ └── set/
│ │ ├── CompactMultiSetMaxTest.java
│ │ └── SetTest.java
│ ├── store/
│ │ ├── EndpointTest.java
│ │ ├── FileBackedMemoryGraphStoreTest.java
│ │ ├── MemoryGraphStoreTest.java
│ │ ├── RecordTest.java
│ │ └── SingleThreadedStringCanonicalizerTest.java
│ ├── structure/
│ │ ├── BitsyGraphStructureTestSuite.java
│ │ ├── BitsyProcessStandardTestSuite.java
│ │ ├── BitsyTestGraphProvider.java
│ │ └── HasLabelTest.java
│ └── util/
│ ├── CommittableFileLogTest.java
│ └── DoubleBufferIT.java
└── resources/
├── com/
│ └── lambdazen/
│ └── bitsy/
│ └── util/
│ └── mobydick.txt
├── gremlin-server/
│ ├── bitsy.properties
│ └── gremlin-server-bitsy.yaml
└── recovery/
├── stage1/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage2/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage3/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage4/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage5/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage6/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
└── stage7/
├── eA.txt
├── eB.txt
├── metaA.txt
├── metaB.txt
├── txA.txt
├── txB.txt
├── vA.txt
└── vB.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .classpath
================================================
<classpath>
<classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
<classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="var" path="M2_REPO/commons-configuration/commons-configuration/1.10/commons-configuration-1.10.jar" sourcepath="M2_REPO/commons-configuration/commons-configuration/1.10/commons-configuration-1.10-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-io/commons-io/2.4/commons-io-2.4.jar" sourcepath="M2_REPO/commons-io/commons-io/2.4/commons-io-2.4-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.6/commons-lang-2.6.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.6/commons-lang-2.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/tinkerpop/gremlin-core/3.3.0/gremlin-core-3.3.0.jar" sourcepath="M2_REPO/org/apache/tinkerpop/gremlin-core/3.3.0/gremlin-core-3.3.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/tinkerpop/gremlin-shaded/3.3.0/gremlin-shaded-3.3.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/tinkerpop/gremlin-test/3.3.0/gremlin-test-3.3.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-all/1.3/hamcrest-all-1.3.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/carrotsearch/hppc/0.7.1/hppc-0.7.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/fasterxml/jackson/core/jackson-annotations/2.9.2/jackson-annotations-2.9.2.jar"/>
<classpathentry kind="var" path="M2_REPO/com/fasterxml/jackson/core/jackson-core/2.9.2/jackson-core-2.9.2.jar"/>
<classpathentry kind="var" path="M2_REPO/com/fasterxml/jackson/core/jackson-databind/2.9.2/jackson-databind-2.9.2.jar"/>
<classpathentry kind="var" path="M2_REPO/com/squareup/javapoet/1.8.0/javapoet-1.8.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/javatuples/javatuples/1.2/javatuples-1.2.jar"/>
<classpathentry kind="var" path="M2_REPO/com/jcabi/jcabi-log/0.14/jcabi-log-0.14.jar"/>
<classpathentry kind="var" path="M2_REPO/com/jcabi/jcabi-manifests/1.1/jcabi-manifests-1.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.7.21/jcl-over-slf4j-1.7.21.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.12/junit-4.12.jar" sourcepath="M2_REPO/junit/junit/4.12/junit-4.12-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.10.19/mockito-core-1.10.19.jar"/>
<classpathentry kind="var" path="M2_REPO/com/nesscomputing/components/ness-core/1.8.0/ness-core-1.8.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/2.1/objenesis-2.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.7.25/slf4j-simple-1.7.25.jar"/>
<classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.15/snakeyaml-1.15.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
</classpath>
================================================
FILE: .git-blame-ignore-revs
================================================
# reformat with Maveniverse parent 39
641fdf861487e91b277fda8f06cc852842d14f60
================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Verify
uses: maveniverse/parent/.github/workflows/ci.yml@release-51
with:
maven-test-run: false # ITs are currently busted and needs to go to separate module
jdk-matrix: '[ "8", "17", "21", "25" ]'
maven-matrix: '[ "3.9.12" ]'
maven-test: './mvnw clean verify -e -B -V -P run-its'
================================================
FILE: .gitignore
================================================
target
*.iml
.idea
*~
================================================
FILE: .mvn/wrapper/maven-wrapper.properties
================================================
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip
================================================
FILE: .project
================================================
<projectDescription>
<name>bitsy</name>
<comment>Bitsy v3 is a small, fast, embeddable, durable in-memory graph database that is compatible with Tinkerpop3. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects/>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
================================================
FILE: .settings/org.eclipse.jdt.core.prefs
================================================
#Thu Nov 02 18:34:43 EDT 2017
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: NOTICE
================================================
This product depends on the following components:
- Tinkerpop Gremlin (gremlin-core, gremlin-test)
http://tinkerpop.apache.org/
Apache 2.0 license
Copyright (c) 2015- The Apache Software Foundation.
- Jackson JSON processor (jackson-core, jackson-databind)
https://github.com/FasterXML/
Apache 2.0 license
Copyright (c) 2007- Tatu Saloranta, tatu.saloranta@iki.fi
- Ness Computing Core Component (components-ness-core)
https://github.com/NessComputing/components-ness-core
Apache 2.0 license
Copyright (C) 2012- Ness Computing, Inc.
- SLF4J API (slf4j-api)
http://www.slf4j.org/
MIT license
Copyright (c) 2004- QOS.ch
================================================
FILE: README.md
================================================
[](https://search.maven.org/artifact/com.lambdazen.bitsy/bitsy)
Bitsy is a small, fast, embeddable, durable in-memory graph database that is compatible with Tinkerpop3.
[The project Wiki](https://github.com/lambdazen/bitsy/wiki) is the official source of documentation. The original version of the database compatible with Tinkerpop2 is available at https://bitbucket.org/lambdazen/bitsy.
### Git branching strategy
Tags are named release-[version]. Versions start with 3.0. For e.g., release-3.0
Development happens on `master` branch.
## Building it
The project **build time requirement** is [Apache Maven](https://maven.apache.org/), at least version 3.9 and Java 21.
The project **run time requirement is Java 8**.
For quick build (runs no tests nor any other plugin like javadoc)
```
mvn clean install -Dtest=void
```
For UT-only build (will run UTs too)
```
mvn clean install
```
For full build (will run UTs and ITs)
```
mvn clean install -P run-its
```
For publishing setup, see [parent POM](https://github.com/maveniverse/parent).
================================================
FILE: mvnw
================================================
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.4
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
scriptDir="$(dirname "$0")"
scriptName="$(basename "$0")"
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"$scriptDir/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${scriptName#mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c - >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
# Find the actual extracted directory name (handles snapshots where filename != directory name)
actualDistributionDir=""
# First try the expected directory name (for regular distributions)
if [ -d "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" ]; then
if [ -f "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/bin/$MVN_CMD" ]; then
actualDistributionDir="$distributionUrlNameMain"
fi
fi
# If not found, search for any directory with the Maven executable (for snapshots)
if [ -z "$actualDistributionDir" ]; then
# enable globbing to iterate over items
set +f
for dir in "$TMP_DOWNLOAD_DIR"/*; do
if [ -d "$dir" ]; then
if [ -f "$dir/bin/$MVN_CMD" ]; then
actualDistributionDir="$(basename "$dir")"
break
fi
fi
done
set -f
fi
if [ -z "$actualDistributionDir" ]; then
verbose "Contents of $TMP_DOWNLOAD_DIR:"
verbose "$(ls -la "$TMP_DOWNLOAD_DIR")"
die "Could not find Maven distribution directory in extracted archive"
fi
verbose "Found extracted Maven distribution directory: $actualDistributionDir"
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$actualDistributionDir/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$actualDistributionDir" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"
================================================
FILE: mvnw.cmd
================================================
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.4
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" ("%__MVNW_CMD__%" %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND -eq $False) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace "^.*$MVNW_REPO_PATTERN",'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_M2_PATH = "$HOME/.m2"
if ($env:MAVEN_USER_HOME) {
$MAVEN_M2_PATH = "$env:MAVEN_USER_HOME"
}
if (-not (Test-Path -Path $MAVEN_M2_PATH)) {
New-Item -Path $MAVEN_M2_PATH -ItemType Directory | Out-Null
}
$MAVEN_WRAPPER_DISTS = $null
if ((Get-Item $MAVEN_M2_PATH).Target[0] -eq $null) {
$MAVEN_WRAPPER_DISTS = "$MAVEN_M2_PATH/wrapper/dists"
} else {
$MAVEN_WRAPPER_DISTS = (Get-Item $MAVEN_M2_PATH).Target[0] + "/wrapper/dists"
}
$MAVEN_HOME_PARENT = "$MAVEN_WRAPPER_DISTS/$distributionUrlNameMain"
$MAVEN_HOME_NAME = ([System.Security.Cryptography.SHA256]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
# Find the actual extracted directory name (handles snapshots where filename != directory name)
$actualDistributionDir = ""
# First try the expected directory name (for regular distributions)
$expectedPath = Join-Path "$TMP_DOWNLOAD_DIR" "$distributionUrlNameMain"
$expectedMvnPath = Join-Path "$expectedPath" "bin/$MVN_CMD"
if ((Test-Path -Path $expectedPath -PathType Container) -and (Test-Path -Path $expectedMvnPath -PathType Leaf)) {
$actualDistributionDir = $distributionUrlNameMain
}
# If not found, search for any directory with the Maven executable (for snapshots)
if (!$actualDistributionDir) {
Get-ChildItem -Path "$TMP_DOWNLOAD_DIR" -Directory | ForEach-Object {
$testPath = Join-Path $_.FullName "bin/$MVN_CMD"
if (Test-Path -Path $testPath -PathType Leaf) {
$actualDistributionDir = $_.Name
}
}
}
if (!$actualDistributionDir) {
Write-Error "Could not find Maven distribution directory in extracted archive"
}
Write-Verbose "Found extracted Maven distribution directory: $actualDistributionDir"
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$actualDistributionDir" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
================================================
FILE: pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>eu.maveniverse.maven.parent</groupId>
<artifactId>parent</artifactId>
<version>51</version>
</parent>
<groupId>com.lambdazen.bitsy</groupId>
<artifactId>bitsy</artifactId>
<version>3.6.5-SNAPSHOT</version>
<name>Bitsy Graph Database</name>
<description>Bitsy v3 is a small, fast, embeddable, durable in-memory graph database that is compatible with Tinkerpop3</description>
<url>https://github.com/lambdazen/bitsy/</url>
<inceptionYear>2013</inceptionYear>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<id>lambdazen</id>
<name>Sridhar Ramachandran</name>
<email>sridhar@lambdazen.com</email>
<url>https://lambdazen.com</url>
</developer>
<developer>
<id>cstamas</id>
<name>Tamas Cservenak</name>
<email>tamas@cservenak.net</email>
<url>https://www.cstamas.org</url>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/lambdazen/bitsy.git</connection>
<developerConnection>scm:git:https://github.com/lambdazen/bitsy.git</developerConnection>
<tag>HEAD</tag>
<url>https://github.com/lambdazen/bitsy/</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.release>8</maven.compiler.release>
<!-- versions -->
<gremlin.version>3.7.5</gremlin.version>
<slf4j.version>1.7.36</slf4j.version>
<!-- JaCoCo: empty -->
<jacocoAgentArg />
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.21.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
<version>${gremlin.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-test</artifactId>
<version>${gremlin.version}</version>
<scope>test</scope>
</dependency>
<!-- TODO: UNCOMMENT WHEN ADDING GREMLIN SERVER TESTS
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-server</artifactId>
<version>${gremlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-driver</artifactId>
<version>${gremlin.version}</version>
<scope>test</scope>
</dependency>
-->
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
<failIfNoTests>false</failIfNoTests>
<argLine>@{jacocoAgentArg} --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED</argLine>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
<java.io.tmpdir>${java.io.tmpdir}</java.io.tmpdir>
<build.dir>${project.build.directory}</build.dir>
</systemPropertyVariables>
<includes>
<include>**/*Test.java</include>
<include>**/*TestCase.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
<failIfNoTests>false</failIfNoTests>
<argLine>@{jacocoAgentArg} --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED</argLine>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
<java.io.tmpdir>${java.io.tmpdir}</java.io.tmpdir>
<build.dir>${project.build.directory}</build.dir>
</systemPropertyVariables>
<includes>
<include>**/*IT.java</include>
<include>**/*ITCase.java</include>
<include>**/*TestSuite.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- Turn off strict javadoc checks in Java-8 -->
<doclint>none</doclint>
<!-- Make it less fragile -->
<detectLinks>false</detectLinks>
<!-- Source == release -->
<source>${maven.compiler.release}</source>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.14</version>
<configuration>
<propertyName>jacocoAgentArg</propertyName>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<!--
Enable running of integration-tests.
-->
<profile>
<id>run-its</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!--
Enable running of coverage reports.
-->
<profile>
<id>coverage</id>
<activation>
<property>
<name>coverage</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
<goal>prepare-agent-integration</goal>
<goal>report</goal>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyEdge.java
================================================
package com.lambdazen.bitsy;
import com.lambdazen.bitsy.ads.dict.Dictionary;
import com.lambdazen.bitsy.store.EdgeBean;
import com.lambdazen.bitsy.store.EdgeBeanJson;
import com.lambdazen.bitsy.tx.BitsyTransaction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
public class BitsyEdge extends BitsyElement implements Edge, IEdge {
UUID outVertexId;
UUID inVertexId;
public BitsyEdge(
UUID id,
Dictionary properties,
BitsyTransaction tx,
BitsyState state,
int version,
String label,
UUID outVertexId,
UUID inVertexId) {
super(id, label, properties, tx, state, version);
if (label == null) {
throw new IllegalArgumentException("Edge label can not be null"); // Enforced by 2.3.0 test case
}
this.outVertexId = outVertexId;
this.inVertexId = inVertexId;
}
public BitsyEdge(EdgeBean bean, BitsyTransaction tx, BitsyState state) {
this(
bean.getId(),
bean.getPropertiesDict(),
tx,
state,
bean.getVersion(),
bean.getLabel(),
bean.getOutVertexId(),
bean.getInVertexId());
}
public EdgeBeanJson asJsonBean() {
// The TX is usually not active at this point. So no checks.
return new EdgeBeanJson((UUID) id, properties, version, label, outVertexId, inVertexId, state);
}
@Override
public Iterator<Vertex> vertices(Direction dir) {
tx.validateForQuery(this);
if (dir != Direction.BOTH) {
Vertex ans = inOrOutVertex(dir);
return Collections.singleton(ans).iterator();
} else {
return bothVertices();
}
}
@Override
public Vertex inVertex() {
tx.validateForQuery(this);
return inOrOutVertex(Direction.IN);
}
@Override
public Vertex outVertex() {
tx.validateForQuery(this);
return inOrOutVertex(Direction.OUT);
}
@Override
public Iterator<Vertex> bothVertices() {
tx.validateForQuery(this);
Vertex inV = inVertex();
Vertex outV = outVertex();
return Arrays.asList(new Vertex[] {outV, inV}).iterator();
}
private Vertex inOrOutVertex(Direction dir) {
Vertex ans = tx.getVertex(getVertexId(dir));
// Vertex may disappear in READ_COMMITTED MODE
if (ans == null) {
throw new BitsyRetryException(
BitsyErrorCodes.CONCURRENT_MODIFICATION,
"The vertex in direction " + dir + " of the edge " + this.id()
+ " was removed by another transaction");
}
return ans;
}
public UUID getInVertexId() {
return inVertexId;
}
public UUID getOutVertexId() {
return outVertexId;
}
public UUID getVertexId(Direction dir) {
if (dir == Direction.IN) {
return inVertexId;
} else if (dir == Direction.OUT) {
return outVertexId;
} else {
throw new IllegalArgumentException("Unsupported direction " + dir);
}
}
public void incrementVersion() {
this.version++;
}
public void remove() {
tx.removeEdge(this);
}
public String toString() {
return StringFactory.edgeString(this);
}
@Override
// THERE ARE TWO MORE COPIES OF THIS CODE IN ELEMENT AND VERTEX
public <T> Iterator<Property<T>> properties(String... propertyKeys) {
ArrayList<Property<T>> ans = new ArrayList<Property<T>>();
if (propertyKeys.length == 0) {
if (this.properties == null) return Collections.emptyIterator();
propertyKeys = this.properties.getPropertyKeys();
}
for (String key : propertyKeys) {
Property<T> prop = property(key);
if (prop.isPresent()) ans.add(prop);
}
return ans.iterator();
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyElement.java
================================================
package com.lambdazen.bitsy;
import com.lambdazen.bitsy.ads.dict.Dictionary;
import com.lambdazen.bitsy.ads.dict.Dictionary1;
import com.lambdazen.bitsy.tx.BitsyTransaction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
public abstract class BitsyElement implements Element {
public static enum PropType {
ELEMENT,
VERTEX,
EDGE
};
Object id;
String label;
Dictionary properties;
BitsyTransaction tx;
BitsyState state;
int version;
boolean updated;
public BitsyElement(
Object id, String label, Dictionary properties, BitsyTransaction tx, BitsyState state, int version) {
this.id = id;
this.label = label;
this.properties = properties;
this.tx = tx;
this.state = state;
this.version = version;
this.updated = false;
}
@Override
public Object id() {
// No TX check to return the ID
return id;
}
@Override
public String label() {
// There is no Tx validation for label because it is used even after deletion to update indexes, etc.
return label;
}
@Override
public Graph graph() {
return tx.graph();
}
public Dictionary getPropertyDict() {
return properties;
}
@Override
public <T> T value(String key) {
tx.validateForQuery(this);
if (properties == null) {
return null;
} else {
return (T) (properties.getProperty(key));
}
}
@Override
public Set<String> keys() {
tx.validateForQuery(this);
if (properties == null) {
return Collections.emptySet();
} else {
return new CopyOnWriteArraySet<String>(Arrays.asList(properties.getPropertyKeys()));
}
}
public <T> T removeProperty(String key) {
markForUpdate();
if (properties == null) {
return null;
} else {
Object ans = properties.getProperty(key);
properties = properties.removeProperty(key);
return (T) ans;
}
}
@Override
public <T> Property<T> property(String key, T value) {
if (value == null) {
throw new IllegalArgumentException(
"A null property can not be stored. You can call removeProperty() instead");
}
markForUpdate();
if (key == null) {
throw new IllegalArgumentException("Expecting non-null key in setProperty");
} else if (key.length() == 0) {
throw new IllegalArgumentException("Expecting non-empty key in setProperty");
} else if (key.equals("id")) {
throw new IllegalArgumentException("Can not set the 'id' property on an element");
} else if (key.equals("label")) {
throw new IllegalArgumentException("Can not set the 'label' property on an element");
} else if (key.charAt(0) == '~') {
throw new IllegalArgumentException("Can not set a property beginning with ~ on an element");
}
if (this.properties == null) {
this.properties = new Dictionary1(key, value);
} else {
this.properties = properties.setProperty(key, value);
}
assert (properties != null);
return new BitsyProperty<T>(this, key, value);
}
// WARNING: THERE IS ONE MORE COPY OF THIS CODE IN VERTEX
@Override
public <T> Property<T> property(String key) {
T value = value(key);
if (value == null) {
return Property.<T>empty();
} else {
return new BitsyProperty<T>(this, key, value);
}
}
// WARNING: THERE ARE TWO MORE COPIES OF THIS CODE IN VERTEX AND EDGE
@Override
public <T> Iterator<? extends Property<T>> properties(String... propertyKeys) {
ArrayList<Property<T>> ans = new ArrayList<Property<T>>();
if (propertyKeys.length == 0) {
if (this.properties == null) return Collections.emptyIterator();
propertyKeys = this.properties.getPropertyKeys();
}
for (String key : propertyKeys) {
Property<T> prop = property(key);
if (prop.isPresent()) ans.add(prop);
}
return ans.iterator();
}
/** This method prepares the vertex/edge for an update */
public void markForUpdate() {
if (!updated) {
updated = true;
// Make a copy of the underlying property map, if non-null
if (properties != null) {
properties = properties.copyOf();
}
tx.markForPropertyUpdate(this);
}
}
@Override
public abstract void remove();
public BitsyState getState() {
return state;
}
public void setState(BitsyState state) {
this.state = state;
}
public int getVersion() {
return version;
}
public ITransaction getTransaction() {
return tx;
}
// Moved to hashCode and equals from ElementHelper -- to pass Gremlin tests
@Override
public int hashCode() {
return ElementHelper.hashCode(this);
}
@Override
public boolean equals(Object object) {
return ElementHelper.areEqual(this, object);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyErrorCodes.java
================================================
package com.lambdazen.bitsy;
public enum BitsyErrorCodes {
INTERNAL_ERROR {
public String toString() {
return "INTERNAL_ERROR: An internal error occurred";
}
},
ACCESS_OUTSIDE_TX_SCOPE {
public String toString() {
return "ACCESS_OUTSIDE_TX_SCOPE: A vertex/edge was accessed outside the scope of the transaction that created it";
}
},
ELEMENT_ALREADY_DELETED {
public String toString() {
return "ELEMENT_ALREADY_DELETED: The vertex/edge being accessed has already been deleted";
}
},
ADDING_EDGE_TO_A_DELETED_VERTEX {
public String toString() {
return "ADDING_EDGE_TO_A_DELETED_VERTEX: A edge was added in a transaction to (Direction.IN) a vertex that was deleted in the same transaction";
}
},
ADDING_EDGE_FROM_A_DELETED_VERTEX {
public String toString() {
return "ADDING_EDGE_FROM_A_DELETED_VERTEX: A edge was added in a transaction from (Direction.OUT) a vertex that was deleted in the same transaction";
}
},
EXCEPTION_IN_FLUSH {
public String toString() {
return "EXCEPTION_IN_FLUSH: The given exception occurred in the different thread while flushing a double buffer";
}
},
BAD_DB_PATH {
public String toString() {
return "BAD_DB_PATH: The given path to the database is not a directory";
}
},
ERROR_INITIALIZING_DB_FILES {
public String toString() {
return "ERROR_INITIALIZING_DB_FILES: The given database file could not be opened or initialized";
}
},
ERROR_READING_FROM_FILE {
public String toString() {
return "ERROR_READING_FROM_FILE: A fatal error occurred while reading from a file. The database may need to be restarted after investigating the root cause";
}
},
ERROR_WRITING_TO_FILE {
public String toString() {
return "ERROR_WRITING_TO_TX_FILE: A fatal error occurred while writing to a transaction file. The database may need to be restarted after investigating the root cause";
}
},
TRANSACTION_INTERRUPTED {
public String toString() {
return "TRANSACTION_INTERRUPTED: The given InterruptedException occurred during a transaction";
}
},
SERIALIZATION_ERROR {
public String toString() {
return "SERIALIZATION_ERROR: The given exception occurred while serializing a commit block using Jackson JSON API";
}
},
ADDING_EDGE_WITH_VERTEX_FROM_ANOTHER_TX {
public String toString() {
return "ADDING_EDGE_WITH_VERTICES_FROM_ANOTHER_TX: An edge was added in a transaction with an endpoint vertex belonging to another transaction";
}
},
REMOVING_VERTEX_FROM_ANOTHER_TX {
public String toString() {
return "REMOVING_VERTEX_FROM_ANOTHER_TX: A vertex was removed in a transaction different from the one in which it was loaded";
}
},
REMOVING_EDGE_FROM_ANOTHER_TX {
public String toString() {
return "REMOVING_EDGE_FROM_ANOTHER_TX: An edge was removed in a transaction different from the one in which it was loaded";
}
},
CHECKSUM_MISMATCH {
public String toString() {
return "CHECKSUM_MISMATCH: Encountered a checksum mismatch while loading a database file";
}
},
CONCURRENT_MODIFICATION {
public String toString() {
return "CONCURRENT_MODIFICATION: A vertex or edge loaded in a transaction was concurrently modified by another transaction. Please retry this transaction";
}
},
ERROR_IN_FILE_HEADER {
public String toString() {
return "ERROR_IN_FILE_HEADER: A fatal error occured while parsing the first line (header) in a database file";
}
},
INCOMPLETE_TX_FLUSH {
public String toString() {
return "INCOMPLETE_TX_FLUSH: A V/E file was not fully flushed when the database was previously shutdown";
}
},
DATABASE_IS_CORRUPT {
public String toString() {
return "DATABASE_IS_CORRUPT: The given error is fatal and the database can not be loaded";
}
},
JAVA_DESERIALIZATION_ERROR {
public String toString() {
return "DESERIALIZATION_ERROR: An error occurred while de-serializing a Java Serializable object";
}
},
INDEX_ALREADY_EXISTS {
public String toString() {
return "INDEX_ALREADY_EXISTS: The given index already exists in the database";
}
},
UNSUPPORTED_INDEX_TYPE {
public String toString() {
return "UNSUPPORTED_INDEX_TYPE: Indexes are only supported on Vertex and Edge classes";
}
},
MISSING_INDEX {
public String toString() {
return "MISSING_INDEX: A vertex/edge query on a matching key-value pair was performed without creating an index for that key";
}
},
OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS {
public String toString() {
return "OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS: The requested operation can not be performed on memory-only graphs";
}
},
FULL_GRAPH_SCANS_ARE_DISABLED {
public String toString() {
return "FULL_GRAPH_SCANS_ARE_DISABLED: The requested operation can not be performed because the BitsyGraph was constructed with the allowFullGraphScans option disabled";
}
},
BAD_BACKUP_PATH {
public String toString() {
return "BAD_BACKUP_PATH: The given path to backup the database is not an empty directory";
}
},
BACKUP_IN_PROGRESS {
public String toString() {
return "BACKUP_IN_PROGRESS: A scheduled backup task is already in progress. Please try after a some time";
}
},
BACKUP_INTERRUPTED {
public String toString() {
return "BACKUP_INTERRUPTED: The given InterruptedException occurred while waiting for a backup to be performed";
}
},
BACKUP_FAILED {
public String toString() {
return "BACKUP_FAILED: The given exception occurred during a backup operation";
}
},
FLUSH_INTERRUPTED {
public String toString() {
return "FLUSH_INTERRUPTED: The given InterruptedException occurrend while waiting for a flush operation on a transaction log to complete";
}
},
INSTANCE_ALREADY_EXISTS {
public String toString() {
return "INSTANCE_ALREADY_EXISTS: A BitsyGraph object with the same path has been registered with the MBeanServer. Creating multiple instances of BitsyGraph (without calling shutdown) will cause data corruption";
}
},
ERROR_REGISTERING_TO_MBEAN_SERVER {
public String toString() {
return "ERROR_REGISTERING_TO_MBEAN_SERVER: A BitsyGraph object could not be registered with the MBeanServer";
}
},
MAJOR_VERSION_MISMATCH {
public String toString() {
return "MAJOR_VERSION_MISMATCH: The database loaded was created with by different major version of Bitsy. Please run 'java com.lambdazen.bitsy.PortDatabase' to upgrade or downgrade the database";
}
},
NO_OLAP_SUPPORT {
public String toString() {
return "NO_OLAP_SUPPORT: Bitsy is not designed to be an OLAP graph";
}
},
NO_MULTI_PROPERTY_SUPPORT {
public String toString() {
return "NO_MULTI_PROPERTY_SUPPORT: Bitsy does not support multi-properties. Please use a list value instead";
}
},
NO_META_PROPERTY_SUPPORT {
public String toString() {
return "NO_META_PROPERTY_SUPPORT: Bitsy does not support meta-properties. Please use property keys such as a.b.c instead";
}
},
NO_CUSTOM_ID_SUPPORT {
public String toString() {
return "NO_CUSTOM_ID_SUPPORT: Bitsy does not support user-supplied IDs for vertices and edges, only auto-generated UUIDs. Please move this to an indexed key";
}
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyException.java
================================================
package com.lambdazen.bitsy;
public class BitsyException extends RuntimeException {
private static final long serialVersionUID = -5310572247323732287L;
BitsyErrorCodes code;
public BitsyException(BitsyErrorCodes code) {
super(code.toString());
this.code = code;
}
public BitsyException(BitsyErrorCodes code, String s) {
super(code.toString() + ". " + s);
this.code = code;
}
public BitsyException(BitsyErrorCodes code, String s, Throwable t) {
super(code.toString() + ". " + s, t);
this.code = code;
}
public BitsyErrorCodes getErrorCode() {
return code;
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyFeatures.java
================================================
package com.lambdazen.bitsy;
import org.apache.tinkerpop.gremlin.structure.Graph.Features;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
public class BitsyFeatures implements Features {
private final GraphFeatures graphFeatures = new BitsyGraphFeatures();
private final VertexFeatures vertexFeatures = new BitsyVertexFeatures();
private final EdgeFeatures edgeFeatures = new BitsyEdgeFeatures();
private boolean isPersistent;
public BitsyFeatures(boolean isPersistent) {
this.isPersistent = isPersistent;
}
@Override
public GraphFeatures graph() {
return graphFeatures;
}
@Override
public EdgeFeatures edge() {
return edgeFeatures;
}
@Override
public VertexFeatures vertex() {
return vertexFeatures;
}
@Override
public String toString() {
return StringFactory.featureString(this);
}
public class BitsyGraphFeatures implements Features.GraphFeatures {
private final Features.VariableFeatures variablesFeatures = new BitsyVariableFeatures();
@Override
public boolean supportsComputer() {
return false;
}
@Override
public Features.VariableFeatures variables() {
return variablesFeatures;
}
@Override
public boolean supportsPersistence() {
return isPersistent;
}
// Yes for transactions
// TODO: Change from no for threaded transactions to yes -- semantics seems to have changed per
// shouldNotReuseThreadedTransaction
@Override
public boolean supportsThreadedTransactions() {
return false;
}
}
public class BitsyVariableFeatures implements Features.VariableFeatures {
@Override
public boolean supportsVariables() {
return false;
}
@Override
public boolean supportsBooleanValues() {
return false;
}
@Override
public boolean supportsDoubleValues() {
return false;
}
@Override
public boolean supportsFloatValues() {
return false;
}
@Override
public boolean supportsIntegerValues() {
return false;
}
@Override
public boolean supportsLongValues() {
return false;
}
@Override
public boolean supportsMapValues() {
return false;
}
@Override
public boolean supportsMixedListValues() {
return false;
}
@Override
public boolean supportsByteValues() {
return false;
}
@Override
public boolean supportsBooleanArrayValues() {
return false;
}
@Override
public boolean supportsByteArrayValues() {
return false;
}
@Override
public boolean supportsDoubleArrayValues() {
return false;
}
@Override
public boolean supportsFloatArrayValues() {
return false;
}
@Override
public boolean supportsIntegerArrayValues() {
return false;
}
@Override
public boolean supportsLongArrayValues() {
return false;
}
@Override
public boolean supportsSerializableValues() {
return false;
}
@Override
public boolean supportsStringValues() {
return false;
}
@Override
public boolean supportsUniformListValues() {
return false;
}
@Override
public boolean supportsStringArrayValues() {
return false;
}
}
public class BitsyVertexFeatures implements Features.VertexFeatures {
private final Features.VertexPropertyFeatures vertexPropertyFeatures = new BitsyGraphPropertyFeatures();
@Override
public Features.VertexPropertyFeatures properties() {
return vertexPropertyFeatures;
}
@Override
public boolean supportsMetaProperties() {
return false;
}
@Override
public boolean supportsMultiProperties() {
return false;
}
@Override
public boolean supportsUserSuppliedIds() {
return false;
}
@Override
public boolean supportsNumericIds() {
return false;
}
@Override
public boolean supportsAnyIds() {
return false;
}
// Yes for add and remove vertices
}
public class BitsyEdgeFeatures implements Features.EdgeFeatures {
private final Features.EdgePropertyFeatures edgePropertyFeatures = new BitsyGraphPropertyFeatures();
@Override
public Features.EdgePropertyFeatures properties() {
return edgePropertyFeatures;
}
@Override
public boolean supportsUserSuppliedIds() {
return false;
}
@Override
public boolean supportsNumericIds() {
return false;
}
@Override
public boolean supportsAnyIds() {
return false;
}
// Yes for add and remove edges
}
public class BitsyGraphPropertyFeatures implements Features.VertexPropertyFeatures, Features.EdgePropertyFeatures {
@Override
public boolean supportsCustomIds() {
return false;
}
@Override
public boolean supportsUserSuppliedIds() {
return false;
}
@Override
public boolean supportsAnyIds() {
return false;
}
@Override
public boolean supportsNumericIds() {
return false;
}
@Override
public boolean supportsStringIds() {
return true;
}
@Override
public boolean supportsUuidIds() {
return false;
}
// Yes for all property types
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyGraph.java
================================================
package com.lambdazen.bitsy;
import com.lambdazen.bitsy.gremlin.BitsyTraversalStrategy;
import com.lambdazen.bitsy.store.FileBackedMemoryGraphStore;
import com.lambdazen.bitsy.store.MemoryGraphStore;
import com.lambdazen.bitsy.tx.BitsyTransaction;
import com.lambdazen.bitsy.tx.BitsyTransactionContext;
import com.lambdazen.bitsy.wrapper.BitsyAutoReloadingGraph;
import java.lang.management.ManagementFactory;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import org.apache.commons.configuration2.BaseConfiguration;
import org.apache.commons.configuration2.Configuration;
import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.io.Io;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Graph.OptIn("com.lambdazen.bitsy.structure.BitsyGraphStructureTestSuite")
@Graph.OptIn("com.lambdazen.bitsy.structure.BitsyProcessStandardTestSuite")
/** Bitsy 3.0 compatible with Tinkerpop 3.0 */
public class BitsyGraph implements Graph, BitsyGraphMBean {
private static final Logger log = LoggerFactory.getLogger(BitsyGraph.class);
public static boolean IS_ANDROID = "The Android Project".equals(System.getProperty("java.specification.vendor"));
// Configuration keys
public static final String DB_PATH_KEY = "dbPath";
public static final String ALLOW_FULL_GRAPH_SCANS_KEY = "allowFullGraphScans";
public static final String DEFAULT_ISOLATION_LEVEL_KEY = "defaultIsolationLevel";
public static final String TX_LOG_THRESHOLD_KEY = "txLogThreshold";
public static final String REORG_FACTOR_KEY = "reorgFactor";
public static final String CREATE_DIR_IF_MISSING_KEY = "createDirIfMissing";
public static final String VERTEX_INDICES_KEY = "vertexIndices";
public static final String EDGE_INDICES_KEY = "edgeIndices";
public static final double DEFAULT_REORG_FACTOR = 1;
public static final long DEFAULT_TX_LOG_THRESHOLD = 4 * 1024 * 1024;
private boolean allowFullGraphScans;
private boolean isPersistent;
private Path dbPath;
private ThreadLocal<BitsyTransaction> curTransaction;
private ThreadLocal<BitsyTransactionContext> curTransactionContext;
private IGraphStore graphStore;
private Features bitsyFeatures;
private ObjectName objectName;
private BitsyIsolationLevel defaultIsolationLevel;
private boolean createDirIfMissing = false;
private Configuration origConfig;
static {
try {
TraversalStrategies.GlobalCache.registerStrategies(
BitsyGraph.class,
TraversalStrategies.GlobalCache.getStrategies(Graph.class)
.clone()
.addStrategies(BitsyTraversalStrategy.instance()));
TraversalStrategies.GlobalCache.registerStrategies(
BitsyAutoReloadingGraph.class,
TraversalStrategies.GlobalCache.getStrategies(Graph.class)
.clone()
.addStrategies(BitsyTraversalStrategy.instance()));
} catch (java.lang.BootstrapMethodError e) {
// Known issue with Android
System.err.println("Not registering traversal strategies");
e.printStackTrace();
}
}
// Protected constructor used by ThreadedBitsyGraph
protected BitsyGraph(char isThreaded, boolean allowFullGraphScans) {
// char isThreaded is used to distinguish this constructor from others
this.allowFullGraphScans = allowFullGraphScans;
}
public BitsyGraph() {
this(true);
}
public BitsyGraph(boolean allowFullGraphScans) {
this(null, true, -1, -1);
}
public BitsyGraph(Path dbPath) {
this(dbPath, true, DEFAULT_TX_LOG_THRESHOLD, DEFAULT_REORG_FACTOR); // Default tx log size is 4MB
}
/**
* Constructor with all configurable parameters
* @param dbPath path to the database files
* @param allowFullGraphScans whether/not iterations on vertices and edges should be supported
* @param txLogThreshold the size of the transaction in bytes after which it will be scheduled to move to V/E files
* @param reorgFactor V/E reorgs are triggered when the size of the V/E files exceeds the initial size by (1 + factor)
*/
public BitsyGraph(Path dbPath, boolean allowFullGraphScans, long txLogThreshold, double reorgFactor) {
this(dbPath, allowFullGraphScans, txLogThreshold, reorgFactor, false);
}
/**
* Constructor with all configurable parameters
* @param dbPath path to the database files
* @param allowFullGraphScans whether/not iterations on vertices and edges should be supported
* @param txLogThreshold the size of the transaction in bytes after which it will be scheduled to move to V/E files
* @param reorgFactor V/E reorgs are triggered when the size of the V/E files exceeds the initial size by (1 + factor)
* @param createDirIfMissing create the Bitsy directory if it is missing
*/
public BitsyGraph(
Path dbPath,
boolean allowFullGraphScans,
long txLogThreshold,
double reorgFactor,
boolean createDirIfMissing) {
this.dbPath = dbPath;
this.allowFullGraphScans = allowFullGraphScans;
this.curTransactionContext = new ThreadLocal<BitsyTransactionContext>();
this.curTransaction = new ThreadLocal<BitsyTransaction>();
this.defaultIsolationLevel = BitsyIsolationLevel.READ_COMMITTED;
this.createDirIfMissing = createDirIfMissing;
if (IS_ANDROID) {
if (isPersistent()) {
// Load from files
this.graphStore = new FileBackedMemoryGraphStore(
new MemoryGraphStore(allowFullGraphScans),
dbPath,
txLogThreshold,
reorgFactor,
createDirIfMissing);
} else {
this.graphStore = new MemoryGraphStore(allowFullGraphScans);
}
} else {
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
if (isPersistent()) {
// Make sure that another BitsyGraph doesn't exist with the same path
try {
this.objectName =
new ObjectName("com.lambdazen.bitsy", "path", ObjectName.quote(dbPath.toString()));
} catch (MalformedObjectNameException e) {
throw new BitsyException(BitsyErrorCodes.INTERNAL_ERROR, "Bug in quoting ObjectName", e);
}
// Check registry
if (server.isRegistered(objectName)) {
throw new BitsyException(BitsyErrorCodes.INSTANCE_ALREADY_EXISTS, "Path " + dbPath.toString());
}
// Load from files
this.graphStore = new FileBackedMemoryGraphStore(
new MemoryGraphStore(allowFullGraphScans),
dbPath,
txLogThreshold,
reorgFactor,
createDirIfMissing);
} else {
this.graphStore = new MemoryGraphStore(allowFullGraphScans);
}
// Register this to the MBeanServer
if (objectName != null) {
try {
server.registerMBean(this, objectName);
} catch (Exception e) {
throw new BitsyException(
BitsyErrorCodes.ERROR_REGISTERING_TO_MBEAN_SERVER, "Encountered exception", e);
}
}
}
this.bitsyFeatures = new BitsyFeatures(isPersistent);
}
/**
* Constructor with a Configuration object with String dbPath, boolean allowFullGraphScans, long txLogThreshold and double reorgFactor
*/
public BitsyGraph(Configuration configuration) {
this(
Paths.get(configuration.getString(DB_PATH_KEY)),
configuration.getBoolean(ALLOW_FULL_GRAPH_SCANS_KEY, Boolean.TRUE),
configuration.getLong(TX_LOG_THRESHOLD_KEY, DEFAULT_TX_LOG_THRESHOLD),
configuration.getDouble(REORG_FACTOR_KEY, DEFAULT_REORG_FACTOR),
configuration.getBoolean(CREATE_DIR_IF_MISSING_KEY, false));
String isoLevelStr = configuration.getString(DEFAULT_ISOLATION_LEVEL_KEY);
if (isoLevelStr != null) {
setDefaultIsolationLevel(BitsyIsolationLevel.valueOf(isoLevelStr));
}
String vertexIndices = configuration.getString(VERTEX_INDICES_KEY);
if (vertexIndices != null) {
createIndices(Vertex.class, vertexIndices);
}
String edgeIndices = configuration.getString(EDGE_INDICES_KEY);
if (edgeIndices != null) {
createIndices(Edge.class, edgeIndices);
}
this.origConfig = configuration;
}
private void createIndices(Class elemType, String vertexIndices) {
for (String indexKey : vertexIndices.split(",")) {
try {
createKeyIndex(indexKey.trim(), elemType);
} catch (BitsyException ex) {
if (ex.getErrorCode() == BitsyErrorCodes.INDEX_ALREADY_EXISTS) {
// That's fine
} else {
throw ex;
}
}
}
}
public static final BitsyGraph open(Configuration configuration) {
return new BitsyGraph(configuration);
}
public String toString() {
if (dbPath != null) {
return "bitsygraph[" + dbPath + "]";
} else {
return "bitsygraph[<in-memory>]";
}
}
/** This method can be used to check if the current thread has an ongoing transaction */
public boolean isTransactionActive() {
ITransaction tx = curTransaction.get();
return (tx != null);
}
public boolean isPersistent() {
return (dbPath != null);
}
public boolean isFullGraphScanAllowed() {
return allowFullGraphScans;
}
public BitsyIsolationLevel getDefaultIsolationLevel() {
return defaultIsolationLevel;
}
public void setDefaultIsolationLevel(BitsyIsolationLevel level) {
this.defaultIsolationLevel = level;
}
public BitsyIsolationLevel getTxIsolationLevel() {
return getTx().getIsolationLevel();
}
public void setTxIsolationLevel(BitsyIsolationLevel level) {
getTx().setIsolationLevel(level);
}
public double getReorgFactor() {
if (!isPersistent()) {
throw new BitsyException(
BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS,
"Reorg factor is only defined for persistent graphs (with a defined path to DB)");
} else {
return ((FileBackedMemoryGraphStore) graphStore)
.getVEReorgPotential()
.getFactor();
}
}
public void setReorgFactor(double factor) {
if (!isPersistent()) {
throw new BitsyException(
BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS,
"Reorg factor is only defined for persistent graphs (with a defined path to DB)");
} else {
((FileBackedMemoryGraphStore) graphStore).getVEReorgPotential().setFactor(factor);
}
}
public int getMinLinesPerReorg() {
if (!isPersistent()) {
throw new BitsyException(
BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS,
"Reorg factor is only defined for persistent graphs (with a defined path to DB)");
} else {
return ((FileBackedMemoryGraphStore) graphStore)
.getVEReorgPotential()
.getMinLinesPerReorg();
}
}
public void setMinLinesPerReorg(int minLinesPerReorg) {
if (!isPersistent()) {
throw new BitsyException(
BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS,
"Reorg factor is only defined for persistent graphs (with a defined path to DB)");
} else {
((FileBackedMemoryGraphStore) graphStore).getVEReorgPotential().setMinLinesPerReorg(minLinesPerReorg);
}
}
public long getTxLogThreshold() {
if (!isPersistent()) {
throw new BitsyException(
BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS,
"Transaction log threshold is only defined for persistent graphs (with a defined path to DB)");
} else {
return ((FileBackedMemoryGraphStore) graphStore)
.getTxLogFlushPotential()
.getTxLogThreshold();
}
}
public void setTxLogThreshold(long txLogThreshold) {
if (!isPersistent()) {
throw new BitsyException(
BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS,
"Transaction log threshold is only defined for persistent graphs (with a defined path to DB)");
} else {
((FileBackedMemoryGraphStore) graphStore).getTxLogFlushPotential().setTxLogThreshold(txLogThreshold);
}
}
/** This method flushes the transaction log to the V/E text files */
public void flushTxLog() {
if (!isPersistent()) {
throw new BitsyException(
BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS,
"Transaction log threshold is only defined for persistent graphs (with a defined path to DB)");
} else {
((FileBackedMemoryGraphStore) graphStore).flushTxLog();
}
}
/** This method backs up the database while it is still operational. Only one backup can be in progress at a time.
*
* @param pathToDir directory to which the database must be backed up.
*/
public void backup(String pathToDir) {
backup(Paths.get(pathToDir));
}
/** This method backs up the database while it is still operational. Only one backup can be in progress at a time.
*
* @param pathToDir directory to which the database must be backed up.
*/
public void backup(Path pathToDir) {
if (!isPersistent()) {
throw new BitsyException(
BitsyErrorCodes.OPERATION_UNDEFINED_FOR_NON_PERSISTENT_GRAPHS,
"Transaction log threshold is only defined for persistent graphs (with a defined path to DB)");
} else {
((FileBackedMemoryGraphStore) graphStore).backup(pathToDir);
}
}
protected BitsyTransaction getTx() {
BitsyTransaction tx = curTransaction.get();
if ((tx == null) || !tx.isOpen()) {
BitsyTransactionContext txContext = curTransactionContext.get();
if (txContext == null) {
txContext = new BitsyTransactionContext(graphStore);
curTransactionContext.set(txContext);
}
tx = new BitsyTransaction(txContext, defaultIsolationLevel, this);
curTransaction.set(tx);
}
return tx;
}
@Override
public ITransaction tx() {
return getTx();
}
/* UNIMPLEMENTED OLAP METHODS */
@Override
public GraphComputer compute() {
throw new UnsupportedOperationException(
"Bitsy doesn't support the compute() method", new BitsyException(BitsyErrorCodes.NO_OLAP_SUPPORT));
}
@Override
public GraphComputer compute(Class graphComputerClass) {
throw new UnsupportedOperationException(
"Bitsy doesn't support the compute() method", new BitsyException(BitsyErrorCodes.NO_OLAP_SUPPORT));
}
@Override
public <I extends Io> I io(final Io.Builder<I> builder) {
return (I) builder.graph(this)
.onMapper(m -> m.addRegistry(BitsyIoRegistryV3d0.instance()))
.create();
}
/* FEATURES */
@Override
public Graph.Features features() {
return bitsyFeatures;
}
/* CONFIGURATION */
@Override
public Configuration configuration() {
if (this.origConfig != null) {
return this.origConfig;
} else {
Configuration ans = new BaseConfiguration();
ans.setProperty(DB_PATH_KEY, dbPath.toString());
ans.setProperty(ALLOW_FULL_GRAPH_SCANS_KEY, allowFullGraphScans);
ans.setProperty(DEFAULT_ISOLATION_LEVEL_KEY, defaultIsolationLevel.toString());
ans.setProperty(TX_LOG_THRESHOLD_KEY, getTxLogThreshold());
ans.setProperty(REORG_FACTOR_KEY, getReorgFactor());
ans.setProperty(CREATE_DIR_IF_MISSING_KEY, createDirIfMissing);
ans.setProperty(VERTEX_INDICES_KEY, String.join(",", getIndexedKeys(Vertex.class)));
ans.setProperty(EDGE_INDICES_KEY, String.join(",", getIndexedKeys(Vertex.class)));
return ans;
}
}
private void validateHomogenousIds(final Object[] ids) {
final Class firstClass = ids[0].getClass();
for (int i = 1; i < ids.length; i++) {
Class curClass = ids[i].getClass();
if (!curClass.equals(firstClass)) {
throw new IllegalArgumentException(
"Argument " + i + " has class " + curClass + " which mismatches arg 0's class " + firstClass);
}
}
}
@Override
public Vertex addVertex(Object... keyValues) {
if (keyValues == null) {
throw new IllegalArgumentException("Expecting non-null arguments in addVertex");
} else if (keyValues.length % 2 == 1) {
throw new IllegalArgumentException(
"Expecting even number of items in the keyValue array. Found " + keyValues.length);
}
// Validate first
for (int i = 0; i < keyValues.length; i = i + 2) {
if (keyValues[i] == T.id) {
// We don't support custom IDs
throw new UnsupportedOperationException(
"Encountered T.id in addVertex", new BitsyException(BitsyErrorCodes.NO_CUSTOM_ID_SUPPORT));
} else if (keyValues[i] == null) {
throw new IllegalArgumentException("Encountered a null key in argument #" + i);
} else if (keyValues[i + 1] == null) {
throw new IllegalArgumentException("Encountered a null value in argument #" + i);
} else if (keyValues[i] == T.label) {
// That's fine
} else if (!(keyValues[i] instanceof String)) {
throw new IllegalArgumentException(
"Encountered a non-string key: " + keyValues[i] + " in argument #" + i);
}
}
// Do the work
final String label = ElementHelper.getLabelValue(keyValues).orElse(null);
BitsyTransaction tx = getTx();
BitsyVertex vertex = new BitsyVertex(UUID.randomUUID(), label, null, tx, BitsyState.M, 0);
for (int i = 0; i < keyValues.length; i = i + 2) {
if (keyValues[i] == T.label) {
// Already found it
} else {
String key = (String) keyValues[i];
vertex.property(key, keyValues[i + 1]);
}
}
tx.addVertex(vertex);
return vertex;
}
@Override
public Iterator<Vertex> vertices(Object... vertexIds) {
if (vertexIds.length == 0) {
if (!allowFullGraphScans) {
throw new BitsyException(BitsyErrorCodes.FULL_GRAPH_SCANS_ARE_DISABLED, "Can not evaluate vertices()");
}
final ITransaction tx = getTx();
return tx.getAllVertices();
} else if (vertexIds.length == 1) {
Vertex vertex = getVertex(vertexIds[0]);
if (vertex == null) {
return Collections.<Vertex>emptyList().iterator();
} else {
return Collections.singletonList(vertex).iterator();
}
} else {
validateHomogenousIds(vertexIds);
List<Vertex> ans = new ArrayList<Vertex>();
for (Object vertexId : vertexIds) {
Vertex vertex = getVertex(vertexId);
if (vertex != null) {
ans.add(vertex);
}
}
return ans.iterator();
}
}
private Vertex getVertex(Object id) {
if (id == null) {
throw new IllegalArgumentException("The vertex ID passed to getVertex() is null");
}
Vertex ans;
if (id instanceof UUID) {
ans = getTx().getVertex((UUID) id);
} else if (id instanceof String) {
// Get the UUID from the string representation -- may fail
UUID uuid;
try {
uuid = UUID.fromString((String) id);
} catch (IllegalArgumentException e) {
// Decoding failed
return null;
}
ans = getTx().getVertex(uuid);
} else if (id instanceof Vertex) {
return getTx().getVertex((UUID) ((Vertex) id).id());
} else {
// Wrong type
ans = null;
}
return ans;
}
private Edge getEdge(Object id) {
if (id == null) {
throw new IllegalArgumentException("The edge ID passed to getEdge() is null");
}
if (id instanceof UUID) {
return getTx().getEdge((UUID) id);
} else if (id instanceof String) {
// Get the UUID from the string representation -- may fail
UUID uuid;
try {
uuid = UUID.fromString((String) id);
} catch (IllegalArgumentException e) {
// Decoding failed
return null;
}
return getTx().getEdge(uuid);
} else if (id instanceof Edge) {
return getTx().getEdge((UUID) ((Edge) id).id());
} else {
// Wrong type
return null;
}
}
public Iterator<Edge> edges(Object... edgeIds) {
if (edgeIds.length == 0) {
if (!allowFullGraphScans) {
throw new BitsyException(BitsyErrorCodes.FULL_GRAPH_SCANS_ARE_DISABLED, "Can not evaluate edges()");
}
final ITransaction tx = getTx();
return tx.getAllEdges();
} else if (edgeIds.length == 1) {
Edge edge = getEdge(edgeIds[0]);
if (edge == null) {
return Collections.<Edge>emptyList().iterator();
} else {
return Collections.singletonList(edge).iterator();
}
} else {
validateHomogenousIds(edgeIds);
List<Edge> ans = new ArrayList<Edge>();
for (Object edgeId : edgeIds) {
Edge edge = getEdge(edgeId);
if (edge != null) {
ans.add(edge);
}
}
return ans.iterator();
}
}
public void shutdown() {
try {
// As per Blueprints tests, shutdown() implies automatic commit
BitsyTransaction tx = curTransaction.get();
if ((tx != null) && tx.isOpen()) {
tx.commit();
tx = null;
}
// Shutdown the underlying store
graphStore.shutdown();
// remove threadlocal to avoid OOM
if (curTransaction != null) {
try {
curTransaction.remove();
curTransactionContext.remove();
} catch (Throwable t) {
// Ignore
}
}
} finally {
if (this.objectName != null) {
// Deregister from JMX
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
try {
server.unregisterMBean(objectName);
} catch (Exception e) {
log.error("Error unregistering MBean named " + objectName + " from the MBeanServer", e);
}
objectName = null;
}
}
}
// Key indexes from TP2 -- now requires TraversalStrategy
public <T extends Element> void createKeyIndex(String key, Class<T> elementType) {
graphStore.createKeyIndex(key, elementType);
}
public <T extends Element> void dropKeyIndex(String key, Class<T> elementType) {
graphStore.dropKeyIndex(key, elementType);
}
public <T extends Element> Set<String> getIndexedKeys(Class<T> elementType) {
return graphStore.getIndexedKeys(elementType);
}
public Iterator<BitsyVertex> verticesByIndex(final String key, final Object value) {
final ITransaction tx = getTx();
return tx.lookupVertices(key, value);
}
public Iterator<BitsyEdge> edgesByIndex(final String key, final Object value) {
final ITransaction tx = getTx();
return tx.lookupEdges(key, value);
}
public IGraphStore getStore() {
return graphStore;
}
@Override
public void close() throws Exception {
this.shutdown();
}
@Override
public Variables variables() {
throw new UnsupportedOperationException("Bitsy doesn't support variables. Please store the data in a vertex");
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyGraphMBean.java
================================================
package com.lambdazen.bitsy;
public interface BitsyGraphMBean {
/**
* Returns the reorgFactor which typically determines when the V?.txt and
* E?.txt file will be reorganized. Reorganization is triggered only when the
* total number of new vertices and edges added is more than the factor
* multiplied by the original number of vertices and edges. Default value is 1.
*/
public double getReorgFactor();
/**
* Set the reorgFactor. A higher number indicates fewer file operations, but
* more disk space and startup time in the worst case. Default value is 1.
*/
public void setReorgFactor(double factor);
/**
* Returns the minimum number of vertices and edges that must be added
* before a reorganization is considered. This rule is used in combination
* with the reorgFactor. Default value is 1000.
*/
public int getMinLinesPerReorg();
/**
* Modify the minimum lines to be added before a reorganization is
* considered. Default value is 1000.
*/
public void setMinLinesPerReorg(int minLinesPerReorg);
/**
* Returns the transaction log threshold which is the minimum size of the
* transaction log (T?.txt) in bytes, before which the contents of the log
* are copied to V?.txt and E?.txt. Default value is 4MB.
*/
public long getTxLogThreshold();
/**
* Modify the transaction log threshold. A higher number indicates fewer
* file operations, but more disk space and startup time in the worst case.
* Default value is 4MB.
*/
public void setTxLogThreshold(long txLogThreshold);
/** This method flushes the transaction log to the V/E text files */
public void flushTxLog();
/** This method backs up the database while it is still operational. Only one backup can be in progress at a time.
*
* @param pathToDir directory to which the database must be backed up.
*/
public void backup(String pathToDir);
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyGraphSONModule.java
================================================
// Copyright 2017 JanusGraph Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.lambdazen.bitsy;
import com.lambdazen.bitsy.store.EdgeBean;
import com.lambdazen.bitsy.store.VertexBean;
import java.io.IOException;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.tinkerpop.gremlin.structure.io.graphson.TinkerPopJacksonModule;
import org.apache.tinkerpop.shaded.jackson.core.*;
import org.apache.tinkerpop.shaded.jackson.core.type.WritableTypeId;
import org.apache.tinkerpop.shaded.jackson.databind.DeserializationContext;
import org.apache.tinkerpop.shaded.jackson.databind.SerializerProvider;
import org.apache.tinkerpop.shaded.jackson.databind.deser.std.StdDeserializer;
import org.apache.tinkerpop.shaded.jackson.databind.jsontype.TypeSerializer;
import org.apache.tinkerpop.shaded.jackson.databind.ser.std.StdSerializer;
/**
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public class BitsyGraphSONModule extends TinkerPopJacksonModule {
private static final String TYPE_NAMESPACE = "bitsy";
private static final Map<Class, String> TYPE_DEFINITIONS =
Collections.unmodifiableMap(new LinkedHashMap<Class, String>() {
{
put(UUID.class, "UUID");
put(VertexBean.class, "VertexBean");
put(EdgeBean.class, "EdgeBean");
}
});
private BitsyGraphSONModule() {
super("bitsy");
addSerializer(UUID.class, new UUIDSerializer());
addDeserializer(UUID.class, new UUIDDeserializer());
// addSerializer(VertexBean.class, new UUIDSerializer());
// addSerializer(EdgeBean.class, new UUIDSerializer());
}
private static final BitsyGraphSONModule INSTANCE = new BitsyGraphSONModule();
public static final BitsyGraphSONModule getInstance() {
return INSTANCE;
}
@Override
public Map<Class, String> getTypeDefinitions() {
return TYPE_DEFINITIONS;
}
@Override
public String getTypeNamespace() {
return TYPE_NAMESPACE;
}
public static class UUIDSerializer extends StdSerializer<UUID> {
public UUIDSerializer() {
super(UUID.class);
}
@Override
public void serialize(
final UUID uuid, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider)
throws IOException, JsonGenerationException {
String uuidStr = UUID.toString(uuid);
jsonGenerator.writeString(uuidStr);
}
@Override
public void serializeWithType(
final UUID uuid,
final JsonGenerator jsonGenerator,
final SerializerProvider serializerProvider,
final TypeSerializer typeSerializer)
throws IOException, JsonProcessingException {
// since jackson 2.9, must keep track of `typeIdDef` in order to close it properly
final WritableTypeId typeIdDef =
typeSerializer.writeTypePrefix(jsonGenerator, typeSerializer.typeId(uuid, JsonToken.VALUE_STRING));
String uuidStr = UUID.toString(uuid);
jsonGenerator.writeString(uuidStr);
typeSerializer.writeTypeSuffix(jsonGenerator, typeIdDef);
}
}
public static class UUIDDeserializer extends StdDeserializer<UUID> {
public UUIDDeserializer() {
super(UUID.class);
}
@Override
public UUID deserialize(final JsonParser jsonParser, final DeserializationContext deserializationContext)
throws IOException, JsonProcessingException {
jsonParser.nextToken();
final String uuidStr = deserializationContext.readValue(jsonParser, String.class);
return UUID.fromString(uuidStr);
}
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyIoRegistryV3d0.java
================================================
package com.lambdazen.bitsy;
import com.lambdazen.bitsy.store.EdgeBean;
import com.lambdazen.bitsy.store.VertexBean;
import org.apache.tinkerpop.gremlin.structure.io.AbstractIoRegistry;
import org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryIo;
import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo;
import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoIo;
import org.apache.tinkerpop.shaded.kryo.Kryo;
import org.apache.tinkerpop.shaded.kryo.Serializer;
import org.apache.tinkerpop.shaded.kryo.io.Input;
import org.apache.tinkerpop.shaded.kryo.io.Output;
public class BitsyIoRegistryV3d0 extends AbstractIoRegistry {
private static final BitsyIoRegistryV3d0 INSTANCE = new BitsyIoRegistryV3d0();
private BitsyIoRegistryV3d0() {
register(GryoIo.class, UUID.class, new UUIDGryoSerializer());
register(GryoIo.class, VertexBean.class, new UUIDGryoSerializer());
register(GryoIo.class, EdgeBean.class, new UUIDGryoSerializer());
register(GraphSONIo.class, UUID.class, BitsyGraphSONModule.getInstance());
register(GraphSONIo.class, VertexBean.class, BitsyGraphSONModule.getInstance());
register(GraphSONIo.class, EdgeBean.class, BitsyGraphSONModule.getInstance());
register(GraphBinaryIo.class, UUID.class, new UUIDGraphBinarySerializer());
register(GraphBinaryIo.class, VertexBean.class, new UUIDGraphBinarySerializer());
register(GraphBinaryIo.class, EdgeBean.class, new UUIDGraphBinarySerializer());
}
public static BitsyIoRegistryV3d0 instance() {
return INSTANCE;
}
static final class UUIDGryoSerializer extends Serializer<UUID> {
@Override
public void write(final Kryo kryo, final Output output, final UUID uuid) {
output.writeLong(uuid.getMostSignificantBits());
output.writeLong(uuid.getLeastSignificantBits());
}
@Override
public UUID read(final Kryo kryo, final Input input, final Class<UUID> aClass) {
long msb = input.readLong();
long lsb = input.readLong();
return new UUID(msb, lsb);
}
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyIsolationLevel.java
================================================
package com.lambdazen.bitsy;
public enum BitsyIsolationLevel {
READ_COMMITTED, // default
REPEATABLE_READ
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyProperty.java
================================================
package com.lambdazen.bitsy;
import java.util.NoSuchElementException;
import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
public class BitsyProperty<T> implements Property<T> {
BitsyElement element;
String key;
T value;
boolean removed = false;
public BitsyProperty(BitsyElement element, String key, T value) {
this.element = element;
this.key = key;
this.value = value;
}
@Override
public String key() {
return key;
}
@Override
public T value() throws NoSuchElementException {
if (removed) {
throw new NoSuchElementException("This property is empty");
} else {
return value;
}
}
@Override
public boolean isPresent() {
return !removed;
}
@Override
public Element element() {
return element;
}
@Override
public void remove() {
if (isPresent()) {
element.removeProperty(key);
this.removed = true;
}
}
// Moved to ElementHelper hashCode and equals in TP3
@Override
public int hashCode() {
return ElementHelper.hashCode(this);
}
@Override
public boolean equals(final Object object) {
return ElementHelper.areEqual(this, object);
}
public String toString() {
return StringFactory.propertyString(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyRetryException.java
================================================
package com.lambdazen.bitsy;
public class BitsyRetryException extends BitsyException {
private static final long serialVersionUID = 976641612846833462L;
BitsyErrorCodes code;
public BitsyRetryException(BitsyErrorCodes code) {
super(code);
}
public BitsyRetryException(BitsyErrorCodes code, String s) {
super(code, s);
}
public BitsyRetryException(BitsyErrorCodes code, String s, Throwable t) {
super(code, s, t);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyState.java
================================================
package com.lambdazen.bitsy;
public enum BitsyState {
U, // unmodified
M, // modified
D // deleted
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyVertex.java
================================================
package com.lambdazen.bitsy;
import com.lambdazen.bitsy.ads.dict.Dictionary;
import com.lambdazen.bitsy.store.IStringCanonicalizer;
import com.lambdazen.bitsy.store.VertexBean;
import com.lambdazen.bitsy.store.VertexBeanJson;
import com.lambdazen.bitsy.tx.BitsyTransaction;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.VertexProperty.Cardinality;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
public class BitsyVertex extends BitsyElement implements Vertex {
private static final Direction[] directions = new Direction[] {Direction.OUT, Direction.IN};
public BitsyVertex(
UUID id, String label, Dictionary properties, BitsyTransaction tx, BitsyState state, int version) {
super(id, label, properties, tx, state, version);
}
public BitsyVertex(VertexBean bean, BitsyTransaction tx, BitsyState state) {
this(bean.getId(), bean.getLabel(), bean.getPropertiesDict(), tx, state, bean.getVersion());
}
@Override
public String label() {
String result = super.label();
return (result == null) ? Vertex.DEFAULT_LABEL : result;
}
@Override
public Iterator<Edge> edges(Direction dir, String... edgeLabels) {
return tx.getEdges(this, dir, edgeLabels).iterator();
}
public VertexBean asBean() {
// The TX is usually not active at this point. So no checks.
return new VertexBean((UUID) id, label, properties, version);
}
public VertexBean asBean(IStringCanonicalizer canonicalizer) {
if (properties != null) {
properties.canonicalizeKeys(canonicalizer);
}
return asBean();
}
public VertexBeanJson asJsonBean() {
// The TX is usually not active at this point. So no checks.
// TreeMap<String, Object> propertyMap = (properties == null) ? null : properties.toMap();
return new VertexBeanJson((UUID) id, label, properties, version, state);
}
@Override
public Iterator<Vertex> vertices(final Direction dir, String... edgeLabels) {
final ArrayList<Vertex> vertices = new ArrayList<Vertex>();
for (Direction myDir : directions) {
if ((myDir == dir) || (dir == Direction.BOTH)) {
Iterator<Edge> iter = edges(myDir, edgeLabels);
while (iter.hasNext()) {
Edge e = iter.next();
Vertex toAdd = (myDir.opposite() == Direction.IN) ? e.inVertex() : e.outVertex();
vertices.add(toAdd);
}
}
}
// Go through the edges and load the vertices
return vertices.iterator();
}
public void incrementVersion() {
// It is OK for the version to wrap around MAX_INT
this.version++;
}
public void remove() {
tx.removeVertex(this);
}
@Override
public Edge addEdge(String label, Vertex inVertex, Object... keyValues) {
if (keyValues.length % 2 == 1) {
throw new IllegalArgumentException(
"Expecting even number of items in the keyValue array. Found " + keyValues.length);
}
if (label == null) {
throw new IllegalArgumentException("You have to specify a non-null String label when adding an edge");
} else if (label.length() == 0) {
throw new IllegalArgumentException("You have to specify a non-empty String label when adding an edge");
} else if (label.charAt(0) == '~') {
throw new IllegalArgumentException("Labels beginning with ~ are invalid");
}
if (inVertex == null) {
throw new IllegalArgumentException("The inVertex supplied to addEdge() is null");
}
// Validate first
for (int i = 0; i < keyValues.length; i = i + 2) {
if (keyValues[i] == T.label) {
throw new UnsupportedOperationException("Encountered T.label in addVertex");
} else if (keyValues[i] == T.id) {
throw new UnsupportedOperationException(
"Encountered T.id in addVertex", new BitsyException(BitsyErrorCodes.NO_CUSTOM_ID_SUPPORT));
} else if (keyValues[i] == null) {
throw new IllegalArgumentException("Encountered a null key in argument #" + i);
} else if (keyValues[i + 1] == null) {
throw new IllegalArgumentException("Encountered a null value in argument #" + i);
} else if (!(keyValues[i] instanceof String)) {
throw new IllegalArgumentException(
"Encountered a non-string key: " + keyValues[i] + " in argument #" + i);
}
}
// Construct the edge with this as the out vertex
BitsyEdge edge =
new BitsyEdge(UUID.randomUUID(), null, tx, BitsyState.M, 0, label, (UUID) id(), (UUID) inVertex.id());
for (int i = 0; i < keyValues.length; i = i + 2) {
String key = (String) keyValues[i];
edge.property(key, keyValues[i + 1]);
}
tx.addEdge(edge);
return edge;
}
public String toString() {
return StringFactory.vertexString(this);
}
// THERE ARE TWO MORE COPIES OF THIS CODE IN ELEMENT AND EDGE
@Override
public <T> VertexProperty<T> property(String key) {
T value = value(key);
if (value == null) {
return VertexProperty.<T>empty();
} else {
return new BitsyVertexProperty<T>(this, key, value);
}
}
@Override
public <V> VertexProperty<V> property(String key, V value) {
super.property(key, value);
return new BitsyVertexProperty<V>(this, key, value);
}
@Override
public <V> VertexProperty<V> property(
final VertexProperty.Cardinality cardinality, final String key, final V value, final Object... keyValues) {
if (cardinality != Cardinality.single) {
// For some reason, TP3 tests fail with this exception
// throw new BitsyException(BitsyErrorCodes.NO_MULTI_PROPERTY_SUPPORT, "Encountered cardinality: " +
// cardinality.toString());
} else if (keyValues.length != 0) {
throw new UnsupportedOperationException(
"Encountered key values: " + keyValues.toString(),
new BitsyException(BitsyErrorCodes.NO_META_PROPERTY_SUPPORT));
}
return property(key, value);
}
// THERE ARE TWO MORE COPIES OF THIS CODE IN ELEMENT AND EDGE
@Override
public <V> Iterator<VertexProperty<V>> properties(String... propertyKeys) {
ArrayList<VertexProperty<V>> ans = new ArrayList<VertexProperty<V>>();
if (propertyKeys.length == 0) {
if (this.properties == null) return Collections.emptyIterator();
propertyKeys = this.properties.getPropertyKeys();
}
for (String key : propertyKeys) {
VertexProperty<V> prop = property(key);
if (prop.isPresent()) ans.add(prop);
}
return ans.iterator();
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/BitsyVertexProperty.java
================================================
package com.lambdazen.bitsy;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
public class BitsyVertexProperty<V> extends BitsyProperty<V> implements VertexProperty<V> {
public BitsyVertexProperty(final BitsyVertex vertex, final String key, final V value) {
super(vertex, key, value);
}
@Override
public Set<String> keys() {
return Collections.emptySet();
}
@Override
public <U> Property<U> property(final String key) {
throw new BitsyException(BitsyErrorCodes.NO_META_PROPERTY_SUPPORT);
}
@Override
public <U> Property<U> property(final String key, final U value) {
throw new BitsyException(BitsyErrorCodes.NO_META_PROPERTY_SUPPORT);
}
@Override
public Vertex element() {
return (BitsyVertex) super.element();
}
@Override
public <U> Iterator<Property<U>> properties(final String... propertyKeys) {
throw new BitsyException(BitsyErrorCodes.NO_META_PROPERTY_SUPPORT);
}
@Override
public Object id() {
return element().id().toString() + ":" + key();
}
public String toString() {
return StringFactory.propertyString(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ICommitChanges.java
================================================
package com.lambdazen.bitsy;
import java.util.Collection;
public interface ICommitChanges {
public Collection<BitsyVertex> getVertexChanges();
public Collection<BitsyEdge> getEdgeChanges();
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/IEdge.java
================================================
package com.lambdazen.bitsy;
public interface IEdge {
public UUID getInVertexId();
public UUID getOutVertexId();
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/IGraphStore.java
================================================
package com.lambdazen.bitsy;
import com.lambdazen.bitsy.store.EdgeBean;
import com.lambdazen.bitsy.store.VertexBean;
import com.lambdazen.bitsy.tx.BitsyTransaction;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Element;
public interface IGraphStore {
public void commit(ICommitChanges changes);
/** Only to be used internally within the store */
public VertexBean getVertex(UUID id);
/** Returns a transaction-specific BitsyVertex given the tx and the ID */
public BitsyVertex getBitsyVertex(BitsyTransaction tx, UUID id);
/** Only to be used internally within the store */
public EdgeBean getEdge(UUID id);
/** Returns a transaction-specific BitsyEdge given the tx and the ID */
public BitsyEdge getBitsyEdge(BitsyTransaction tx, UUID id);
public List<EdgeBean> getEdges(UUID vertexId, Direction dir, String[] edgeLabels);
public Collection<VertexBean> getAllVertices();
public Collection<EdgeBean> getAllEdges();
public <T extends Element> void createKeyIndex(String key, Class<T> elementType);
public <T extends Element> void dropKeyIndex(String key, Class<T> elementType);
public <T extends Element> Set<String> getIndexedKeys(Class<T> elementType);
public void shutdown();
public Collection<VertexBean> lookupVertices(String key, Object value);
public Collection<EdgeBean> lookupEdges(String key, Object value);
public boolean allowFullGraphScans();
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ITransaction.java
================================================
package com.lambdazen.bitsy;
import java.util.Iterator;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.apache.tinkerpop.gremlin.structure.Edge;
import org.apache.tinkerpop.gremlin.structure.Transaction;
import org.apache.tinkerpop.gremlin.structure.Vertex;
public interface ITransaction extends Transaction {
public void save(boolean commit);
public void validateForQuery(BitsyElement bitsyElement) throws BitsyException;
public Vertex getVertex(UUID outVertexId) throws BitsyException;
public Edge getEdge(UUID id) throws BitsyException;
public Iterable<Edge> getEdges(BitsyVertex bitsyVertex, Direction dir, String... edgeLabels) throws BitsyException;
public void markForPropertyUpdate(BitsyElement bitsyElement) throws BitsyException;
public void addVertex(BitsyVertex vertex) throws BitsyException;
public void removeVertex(BitsyVertex vertex) throws BitsyException;
public void addEdge(BitsyEdge edge) throws BitsyException;
public void removeEdge(BitsyEdge edge) throws BitsyException;
public Iterator<Vertex> getAllVertices();
public Iterator<Edge> getAllEdges();
public Iterator<BitsyVertex> lookupVertices(String key, Object value);
public Iterator<BitsyEdge> lookupEdges(String key, Object value);
public BitsyIsolationLevel getIsolationLevel();
public void setIsolationLevel(BitsyIsolationLevel level);
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/PortDatabase.java
================================================
package com.lambdazen.bitsy;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** This class ports the database files across major versions */
public class PortDatabase {
public static final List<String> SUPPORTED_VERSIONS = Arrays.asList(new String[] {"1.0", "1.5"});
private static final String[] FILE_NAMES =
new String[] {"metaA.txt", "metaB.txt", "vA.txt", "vB.txt", "eA.txt", "eB.txt", "txA.txt", "txB.txt"};
private static final Charset UTF8 = Charset.forName("UTF-8");
String targetVersion;
Path sourcePath;
Path targetPath;
String sourceVersion;
String error = null;
public PortDatabase(String[] args) throws IOException {
if (args.length == 0) {
setError("No arguments provided");
return;
} else if (args.length != 4) {
setError("Expecting 4 arguments");
return;
}
this.targetVersion = null;
int i;
for (i = 0; i < args.length - 1; i++) {
if (args[i].equals("-toVersion")) {
targetVersion = args[i + 1];
break;
}
}
String sourceDir = (i == 0) ? args[2] : args[0];
String targetDir = (i == 2) ? args[1] : args[3];
if (targetVersion == null) {
setError("Could not find -toVersion flag followed by a version number");
return;
} else if (!SUPPORTED_VERSIONS.contains(targetVersion)) {
setError("The version number " + targetVersion
+ " provided in the -toVersion flag is not supported. You must provide one of the following: "
+ SUPPORTED_VERSIONS);
return;
}
this.sourcePath = Paths.get(sourceDir);
this.targetPath = Paths.get(targetDir);
if (!Files.isDirectory(sourcePath)) {
setError("Source path " + sourceDir + " does not point to a directory");
return;
}
if (!Files.isDirectory(targetPath)) {
setError("Target path " + targetDir + " does not point to a directory");
return;
}
this.sourceVersion = getVersion(sourcePath);
if (sourceVersion == null) {
return;
}
if (!SUPPORTED_VERSIONS.contains(sourceVersion)) {
setError("The version number " + sourceVersion
+ " found in the source database is not supported. You must provide a database created by one of these versions of Bitsy: "
+ SUPPORTED_VERSIONS);
return;
}
if (sourceVersion.equals(targetVersion)) {
setError("The source and target version numbers are the same: Version " + sourceVersion);
return;
}
System.out.println("Porting database in " + sourceDir + " from version " + sourceVersion + " to version "
+ targetVersion + " under " + targetDir);
portDatabase();
System.out.println("Success");
}
private void portDatabase() throws IOException {
Converter converter;
if (sourceVersion.equals("1.0") && targetVersion.equals("1.5")) {
converter = new V10ToV15Coverter();
} else if (sourceVersion.equals("1.5") && targetVersion.equals("1.0")) {
converter = new V15ToV10Coverter();
} else {
setError("PortDatabase does not support porting from source version " + sourceVersion
+ " to target version " + targetVersion);
return;
}
for (String fileName : FILE_NAMES) {
Path path = sourcePath.resolve(fileName);
InputStream fis = null;
BufferedReader br = null;
OutputStream fos = null;
try {
fis = Files.newInputStream(path);
fos = Files.newOutputStream(targetPath.resolve(fileName));
br = new BufferedReader(new InputStreamReader(fis, UTF8));
String line;
int lineNo = 0;
while ((line = br.readLine()) != null) {
String outLine = converter.convert(line, lineNo, fileName);
if (outLine != null) {
fos.write(outLine.getBytes(UTF8));
fos.write('\n');
}
}
} finally {
if (br != null) {
br.close();
}
if (fis != null) {
fis.close();
}
if (fos != null) {
fos.close();
}
}
}
}
private String getVersion(Path sourcePath) throws IOException {
Path mA = sourcePath.resolve("metaA.txt");
Path mB = sourcePath.resolve("metaB.txt");
String version = "1.0";
boolean missingFiles = true;
if (Files.exists(mA)) {
String versionA = getVersionFromPath(mA);
if (versionA != null) {
version = versionA;
}
missingFiles = false;
}
if (Files.exists(mB)) {
String versionB = getVersionFromPath(mB);
if (versionB != null) {
version = versionB;
}
missingFiles = false;
}
if (missingFiles) {
setError("Neither metaA.txt nor metaB.txt can be found in " + sourcePath);
return null;
} else {
return version;
}
}
public String getVersionFromPath(Path metaPath) throws IOException {
String fileName = metaPath.toString();
try (BufferedReader br = Files.newBufferedReader(metaPath, StandardCharsets.UTF_8)) {
String line;
int lineNo = 0;
while ((line = br.readLine()) != null) {
lineNo++;
int hashPos = line.lastIndexOf('#');
if (hashPos < 0) {
throw new BitsyException(
BitsyErrorCodes.CHECKSUM_MISMATCH,
"Line " + lineNo + " in file " + fileName + " has no hash-code. Encountered " + line);
} else {
String hashCode = line.substring(hashPos + 1);
String expHashCode = toHex(line.substring(0, hashPos + 1).hashCode());
if (!hashCode.endsWith(expHashCode)) {
throw new BitsyException(
BitsyErrorCodes.CHECKSUM_MISMATCH,
"Line " + lineNo + " in file " + fileName + " has the wrong hash-code " + hashCode
+ ". Expected " + expHashCode);
} else {
// All OK
char typeChar = line.charAt(0);
String version = line.substring(2, hashPos);
if (typeChar == 'M') {
return version;
}
}
}
}
}
return null;
}
private void setError(String error) {
this.error = error;
}
private String getError() {
return error;
}
private static void printUsage(String error) {
if (error != null) {
System.err.println("ERROR: " + error);
}
System.err.println(
"Usage: java com.lambdazen.bitsy.PortDatabase -toVersion <target version number> <source directory> <target directory>");
}
public static void main(String[] args) {
try {
PortDatabase task = new PortDatabase(args);
if (task.getError() != null) {
printUsage(task.getError());
System.exit(1);
}
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
// Faster than Integer.toHexString()
private static final char[] HEX_CHAR_ARR = "0123456789abcdef".toCharArray();
private static String toHex(int input) {
final char[] sb = new char[8];
final int len = (sb.length - 1);
for (int i = 0; i <= len; i++) { // MSB
sb[i] = HEX_CHAR_ARR[((int) (input >>> ((len - i) << 2))) & 0xF];
}
return new String(sb);
}
public interface Converter {
public String convert(String line, int lineNo, String fileName);
}
public class V10ToV15Coverter implements Converter {
Pattern edgePat = Pattern.compile("^(E=\\{[^{}]*,\"p\":)\\[\"java.util.TreeMap\",(.*)\\]\\}#[0-9a-zA-Z]*$");
@Override
public String convert(String line, int lineNo, String fileName) {
if (line.startsWith("H=") && fileName.startsWith("meta")) {
String versionLine = "M=1.5#";
return line + "\n" + versionLine + toHex(versionLine.hashCode());
} else if (line.startsWith("E=")) {
Matcher m = edgePat.matcher(line);
if (!m.find()) {
return line;
} else {
// Move from TreeMap to Map
line = m.group(1) + m.group(2) + "}#";
return line + toHex(line.hashCode());
}
} else {
return line;
}
}
}
public class V15ToV10Coverter implements Converter {
Pattern edgePat = Pattern.compile("^(E=\\{[^{}]*,\"p\":)(.*)\\}#[0-9a-zA-Z]*$");
@Override
public String convert(String line, int lineNo, String fileName) {
if (line.startsWith("M=") && fileName.startsWith("meta")) {
// Skip the version
return null;
} else if (line.startsWith("E=")) {
Matcher m = edgePat.matcher(line);
if (!m.find()) {
return line;
} else {
// Move from TreeMap to Map
line = m.group(1) + "[\"java.util.TreeMap\"," + m.group(2) + "]}#";
return line + toHex(line.hashCode());
}
} else {
return line;
}
}
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ThreadedBitsyGraph.java
================================================
package com.lambdazen.bitsy;
import com.lambdazen.bitsy.tx.BitsyTransaction;
import com.lambdazen.bitsy.tx.BitsyTransactionContext;
public class ThreadedBitsyGraph extends BitsyGraph {
BitsyGraph underlyingGraph;
BitsyTransaction tx;
public ThreadedBitsyGraph(BitsyGraph g) {
// Using protected constructor that doesn't create a graph store
super('_', g.isFullGraphScanAllowed());
this.underlyingGraph = g;
this.tx = null;
}
public String toString() {
return underlyingGraph.toString();
}
@Override
public Features features() {
return underlyingGraph.features();
}
@Override
protected BitsyTransaction getTx() {
// Overriding the getTx() method ensures that the work will be done on
// the local transaction, NOT the ThreadLocal transaction
if ((tx == null) || (!tx.isOpen())) {
this.tx = new BitsyTransaction(
new BitsyTransactionContext(underlyingGraph.getStore()),
getDefaultIsolationLevel(),
underlyingGraph);
}
return tx;
}
@Override
/** This method can be used to check if the current threaded-graph is actively executing a transaction */
public boolean isTransactionActive() {
return (tx != null);
}
public BitsyIsolationLevel getDefaultIsolationLevel() {
return underlyingGraph.getDefaultIsolationLevel();
}
public void setDefaultIsolationLevel(BitsyIsolationLevel level) {
underlyingGraph.setDefaultIsolationLevel(level);
}
public BitsyIsolationLevel getTxIsolationLevel() {
return getTx().getIsolationLevel();
}
public void setTxIsolationLevel(BitsyIsolationLevel level) {
getTx().setIsolationLevel(level);
}
@Override
public void shutdown() {
// As per Blueprints tests, shutdown() implies automatic commit
if (tx == null) {
// Nothing to do
} else {
try {
// Stop the old transaction if it exists
tx.commit();
} finally {
// Remove this transaction -- independent of success/failure
this.tx = null;
}
}
// Don't mess with the graph store -- this is only a ThreadedGraph, not the main one
}
// @Deprecated
// public void stopTransaction(Conclusion conclusion) {
// stopTx(conclusion == Conclusion.SUCCESS);
// }
// @Override
// public void commit() {
// tx.save(commit);
// }
//
// @Override
// public void rollback() {
// stopTx(false);
// }
//
// public void stopTx(boolean commit) {
// if (tx == null) {
// // Nothing to do
// } else {
// try {
// // Stop the old transaction if it exists
// tx.save(commit);
// } finally {
// // Remove this transaction -- independent of success/failure
// this.tx = null;
// }
// }
// }
//
// @Override
// public TransactionalGraph startTransaction() {
// throw new UnsupportedOperationException("Can not startTransaction on a threaded transaction graph");
// }
//
// @Override
// public void shutdown() {
// // As per Blueprints tests, shutdown() implies automatic commit
// stopTx(true);
//
// // Don't mess with the graph store -- this is only a ThreadedGraph, not the main one
// }
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/UUID.java
================================================
package com.lambdazen.bitsy;
import com.fasterxml.jackson.annotation.JsonIgnore;
/** This class captures a UUID and is modeled after java.util.UUID */
public class UUID implements Comparable<UUID> {
// Java guarantees that
// "Reads and writes are atomic for reference variables and for most primitive variables (all types except long and
// double)."
// Therefore, mostSigBits and leastSigBits must not be changed during the lifetime of this object.
// Also, these objects must not be accessible to other threads without a memory flush/fence/barrier
// Typically this memory barrier is handled by the ConcurrentHashMap that holds the vertex/edge bean.
private final long mostSigBits;
private final long leastSigBits;
public UUID(long msb, long lsb) {
this.mostSigBits = msb;
this.leastSigBits = lsb;
}
@JsonIgnore
public long getMostSignificantBits() {
return mostSigBits;
}
@JsonIgnore
public long getLeastSignificantBits() {
return leastSigBits;
}
public String toString() {
return uuidRepr();
}
public String uuidRepr() {
return new java.util.UUID(mostSigBits, leastSigBits).toString();
}
public static UUID fromString(String str) {
java.util.UUID ans = java.util.UUID.fromString(str);
return new UUID(ans.getMostSignificantBits(), ans.getLeastSignificantBits());
}
public static UUID randomUUID() {
java.util.UUID ans = java.util.UUID.randomUUID();
return new UUID(ans.getMostSignificantBits(), ans.getLeastSignificantBits());
}
public int compareTo(UUID other) {
if (this.mostSigBits < other.mostSigBits) {
return -1;
} else if (this.mostSigBits > other.mostSigBits) {
return 1;
} else if (this.leastSigBits < other.leastSigBits) {
return -1;
} else if (this.leastSigBits > other.leastSigBits) {
return 1;
} else {
return 0;
}
}
@Override
public int hashCode() {
// Same as java.util.UUID
long hilo = mostSigBits ^ leastSigBits;
return ((int) (hilo >> 32)) ^ (int) hilo;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else {
try {
UUID other = (UUID) obj;
return (mostSigBits == other.getMostSignificantBits())
&& (leastSigBits == other.getLeastSignificantBits());
} catch (ClassCastException e) {
return false;
}
}
}
public static String toString(UUID obj) {
return new java.util.UUID(obj.getMostSignificantBits(), obj.getLeastSignificantBits()).toString();
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/UUIDGraphBinarySerializer.java
================================================
package com.lambdazen.bitsy;
import java.io.IOException;
import org.apache.tinkerpop.gremlin.structure.io.Buffer;
import org.apache.tinkerpop.gremlin.structure.io.binary.DataType;
import org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryReader;
import org.apache.tinkerpop.gremlin.structure.io.binary.GraphBinaryWriter;
import org.apache.tinkerpop.gremlin.structure.io.binary.types.CustomTypeSerializer;
public class UUIDGraphBinarySerializer implements CustomTypeSerializer<UUID> {
private final byte[] typeInfoBuffer = new byte[] {0, 0, 0, 0};
@Override
public String getTypeName() {
return "bitsy.UUID";
}
@Override
public DataType getDataType() {
return DataType.CUSTOM;
}
@Override
public UUID read(Buffer buffer, GraphBinaryReader context) throws IOException {
// {custom type info}, {value_flag} and {value}
// No custom_type_info
if (buffer.readInt() != 0) {
throw new IOException("{custom_type_info} should not be provided for this custom type");
}
return readValue(buffer, context, true);
}
@Override
public UUID readValue(Buffer buffer, GraphBinaryReader context, boolean nullable) throws IOException {
if (nullable) {
final byte valueFlag = buffer.readByte();
if ((valueFlag & 1) == 1) {
return null;
}
}
// Read the byte length of the value bytes
final int valueLength = buffer.readInt();
if (valueLength <= 0) {
throw new IOException(String.format("Unexpected value length: %d", valueLength));
}
if (valueLength > buffer.readableBytes()) {
throw new IOException(
String.format("Not enough readable bytes: %d (expected %d)", valueLength, buffer.readableBytes()));
}
long msb = context.readValue(buffer, Long.class, false);
long lsb = context.readValue(buffer, Long.class, false);
return new UUID(msb, lsb);
}
@Override
public void write(UUID value, Buffer buffer, GraphBinaryWriter context) throws IOException {
// Write {custom type info}, {value_flag} and {value}
buffer.writeBytes(typeInfoBuffer);
writeValue(value, buffer, context, true);
}
@Override
public void writeValue(UUID value, Buffer buffer, GraphBinaryWriter context, boolean nullable) throws IOException {
if (value == null) {
if (!nullable) {
throw new IOException("Unexpected null value when nullable is false");
}
context.writeValueFlagNull(buffer);
return;
}
if (nullable) {
context.writeValueFlagNone(buffer);
}
final Long msb = value.getMostSignificantBits();
final Long lsb = value.getLeastSignificantBits();
// value_length = name_byte_length + long + long
buffer.writeInt(4 + 8 + 8);
context.writeValue(msb, buffer, false);
context.writeValue(lsb, buffer, false);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary.java
================================================
package com.lambdazen.bitsy.ads.dict;
import com.lambdazen.bitsy.store.IStringCanonicalizer;
/**
* This is an re-organizing (not immutable) map from String to Object. The set
* and remove methods return a reference to a new map with the value.
*/
public interface Dictionary {
public int size();
public Object getProperty(String key);
public String[] getPropertyKeys();
public Dictionary setProperty(String key, Object value);
public Dictionary removeProperty(String key);
public Dictionary copyOf();
// public TreeMap<String, Object> toMap();
public void canonicalizeKeys(IStringCanonicalizer canonicalizer);
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary1.java
================================================
package com.lambdazen.bitsy.ads.dict;
/** This class implements a dictionary with one element */
public class Dictionary1 extends PrimitiveDictionary implements Dictionary {
public static final int CAPACITY = 1;
String key0;
Object value0;
// Expand constructor
public Dictionary1(String key, Object value) {
this.key0 = key;
this.value0 = value;
}
// Contract constructor
public Dictionary1(Dictionary2 base) {
this.key0 = base.key0;
this.value0 = base.value0;
}
// Copy constructor
public Dictionary1(Dictionary1 base) {
this.key0 = base.key0;
this.value0 = base.value0;
}
@Override
protected String[] keys() {
return new String[] {key0};
}
@Override
protected Object[] values() {
return new Object[] {value0};
}
@Override
public Dictionary copyOf() {
return new Dictionary1(this);
}
protected int contractThreshold() {
return 0;
}
protected Dictionary contract() {
return null;
}
protected Dictionary expand(String key, Object value) {
return new Dictionary2(this, key, value);
}
protected void write(int index, String key, Object value) {
key0 = key;
value0 = value;
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary11.java
================================================
package com.lambdazen.bitsy.ads.dict;
public class Dictionary11 extends PrimitiveDictionary implements Dictionary {
public static final int CAPACITY = 11;
String key0;
Object value0;
String key1;
Object value1;
String key2;
Object value2;
String key3;
Object value3;
String key4;
Object value4;
String key5;
Object value5;
String key6;
Object value6;
String key7;
Object value7;
String key8;
Object value8;
String key9;
Object value9;
String key10;
Object value10;
// Expand constructor
public Dictionary11(Dictionary8 base, String key, Object value) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
this.key6 = base.key6;
this.value6 = base.value6;
this.key7 = base.key7;
this.value7 = base.value7;
// Last key
this.key8 = key;
this.value8 = value;
}
// Contract constructor
public Dictionary11(Dictionary16 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
this.key6 = base.key6;
this.value6 = base.value6;
this.key7 = base.key7;
this.value7 = base.value7;
this.key8 = base.key8;
this.value8 = base.value8;
this.key9 = base.key9;
this.value9 = base.value9;
this.key10 = base.key10;
this.value10 = base.value10;
}
// Copy constructor
public Dictionary11(Dictionary11 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
this.key6 = base.key6;
this.value6 = base.value6;
this.key7 = base.key7;
this.value7 = base.value7;
this.key8 = base.key8;
this.value8 = base.value8;
this.key9 = base.key9;
this.value9 = base.value9;
this.key10 = base.key10;
this.value10 = base.value10;
}
// FromMap constructor
public Dictionary11(String[] keys, Object[] values) {
this.key0 = lookupKey(keys, 0);
this.value0 = lookupValue(values, 0);
this.key1 = lookupKey(keys, 1);
this.value1 = lookupValue(values, 1);
this.key2 = lookupKey(keys, 2);
this.value2 = lookupValue(values, 2);
this.key3 = lookupKey(keys, 3);
this.value3 = lookupValue(values, 3);
this.key4 = lookupKey(keys, 4);
this.value4 = lookupValue(values, 4);
this.key5 = lookupKey(keys, 5);
this.value5 = lookupValue(values, 5);
this.key6 = lookupKey(keys, 6);
this.value6 = lookupValue(values, 6);
this.key7 = lookupKey(keys, 7);
this.value7 = lookupValue(values, 7);
this.key8 = lookupKey(keys, 8);
this.value8 = lookupValue(values, 8);
this.key9 = lookupKey(keys, 9);
this.value9 = lookupValue(values, 9);
this.key10 = lookupKey(keys, 10);
this.value10 = lookupValue(values, 10);
}
@Override
String[] keys() {
return new String[] {key0, key1, key2, key3, key4, key5, key6, key7, key8, key9, key10};
}
@Override
Object[] values() {
return new Object[] {value0, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10};
}
@Override
void write(int index, String key, Object value) {
if (index < 6) {
switch (index) {
case 0:
key0 = key;
value0 = value;
break;
case 1:
key1 = key;
value1 = value;
break;
case 2:
key2 = key;
value2 = value;
break;
case 3:
key3 = key;
value3 = value;
break;
case 4:
key4 = key;
value4 = value;
break;
case 5:
key5 = key;
value5 = value;
break;
default:
throw new RuntimeException("Bug in code");
}
} else {
switch (index) {
case 6:
key6 = key;
value6 = value;
break;
case 7:
key7 = key;
value7 = value;
break;
case 8:
key8 = key;
value8 = value;
break;
case 9:
key9 = key;
value9 = value;
break;
case 10:
key10 = key;
value10 = value;
break;
default:
throw new IllegalArgumentException("Invalid index " + index);
}
}
}
@Override
Dictionary expand(String key, Object value) {
return new Dictionary16(this, key, value);
}
@Override
int contractThreshold() {
return Dictionary8.CAPACITY;
}
@Override
Dictionary contract() {
return new Dictionary8(this);
}
@Override
public Dictionary copyOf() {
return new Dictionary11(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary16.java
================================================
package com.lambdazen.bitsy.ads.dict;
import java.util.Arrays;
public class Dictionary16 extends PrimitiveDictionary implements Dictionary {
public static final int CAPACITY = 16;
String key0;
Object value0;
String key1;
Object value1;
String key2;
Object value2;
String key3;
Object value3;
String key4;
Object value4;
String key5;
Object value5;
String key6;
Object value6;
String key7;
Object value7;
String key8;
Object value8;
String key9;
Object value9;
String key10;
Object value10;
String key11;
Object value11;
String key12;
Object value12;
String key13;
Object value13;
String key14;
Object value14;
String key15;
Object value15;
// Expand constructor
public Dictionary16(Dictionary11 base, String key, Object value) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
this.key6 = base.key6;
this.value6 = base.value6;
this.key7 = base.key7;
this.value7 = base.value7;
this.key8 = base.key8;
this.value8 = base.value8;
this.key9 = base.key9;
this.value9 = base.value9;
this.key10 = base.key10;
this.value10 = base.value10;
// Last key
this.key11 = key;
this.value11 = value;
}
// Contract constructor
public Dictionary16(DictionaryMax base) {
String[] keys = Arrays.copyOf(base.keys(), 16);
Object[] values = Arrays.copyOf(base.values(), 16);
this.key0 = keys[0];
this.value0 = values[0];
this.key1 = keys[1];
this.value1 = values[1];
this.key2 = keys[2];
this.value2 = values[2];
this.key3 = keys[3];
this.value3 = values[3];
this.key4 = keys[4];
this.value4 = values[4];
this.key5 = keys[5];
this.value5 = values[5];
this.key6 = keys[6];
this.value6 = values[6];
this.key7 = keys[7];
this.value7 = values[7];
this.key8 = keys[8];
this.value8 = values[8];
this.key9 = keys[9];
this.value9 = values[9];
this.key10 = keys[10];
this.value10 = values[10];
this.key11 = keys[11];
this.value11 = values[11];
this.key12 = keys[12];
this.value12 = values[12];
this.key13 = keys[13];
this.value13 = values[13];
this.key14 = keys[14];
this.value14 = values[14];
this.key15 = keys[15];
this.value15 = values[15];
}
// Copy constructor
public Dictionary16(Dictionary16 base) {
String[] keys = Arrays.copyOf(base.keys(), 16);
Object[] values = Arrays.copyOf(base.values(), 16);
this.key0 = keys[0];
this.value0 = values[0];
this.key1 = keys[1];
this.value1 = values[1];
this.key2 = keys[2];
this.value2 = values[2];
this.key3 = keys[3];
this.value3 = values[3];
this.key4 = keys[4];
this.value4 = values[4];
this.key5 = keys[5];
this.value5 = values[5];
this.key6 = keys[6];
this.value6 = values[6];
this.key7 = keys[7];
this.value7 = values[7];
this.key8 = keys[8];
this.value8 = values[8];
this.key9 = keys[9];
this.value9 = values[9];
this.key10 = keys[10];
this.value10 = values[10];
this.key11 = keys[11];
this.value11 = values[11];
this.key12 = keys[12];
this.value12 = values[12];
this.key13 = keys[13];
this.value13 = values[13];
this.key14 = keys[14];
this.value14 = values[14];
this.key15 = keys[15];
this.value15 = values[15];
}
// FromMap constructor
public Dictionary16(String[] keys, Object[] values) {
this.key0 = lookupKey(keys, 0);
this.value0 = lookupValue(values, 0);
this.key1 = lookupKey(keys, 1);
this.value1 = lookupValue(values, 1);
this.key2 = lookupKey(keys, 2);
this.value2 = lookupValue(values, 2);
this.key3 = lookupKey(keys, 3);
this.value3 = lookupValue(values, 3);
this.key4 = lookupKey(keys, 4);
this.value4 = lookupValue(values, 4);
this.key5 = lookupKey(keys, 5);
this.value5 = lookupValue(values, 5);
this.key6 = lookupKey(keys, 6);
this.value6 = lookupValue(values, 6);
this.key7 = lookupKey(keys, 7);
this.value7 = lookupValue(values, 7);
this.key8 = lookupKey(keys, 8);
this.value8 = lookupValue(values, 8);
this.key9 = lookupKey(keys, 9);
this.value9 = lookupValue(values, 9);
this.key10 = lookupKey(keys, 10);
this.value10 = lookupValue(values, 10);
this.key11 = lookupKey(keys, 11);
this.value11 = lookupValue(values, 11);
this.key12 = lookupKey(keys, 12);
this.value12 = lookupValue(values, 12);
this.key13 = lookupKey(keys, 13);
this.value13 = lookupValue(values, 13);
this.key14 = lookupKey(keys, 14);
this.value14 = lookupValue(values, 14);
this.key15 = lookupKey(keys, 15);
this.value15 = lookupValue(values, 15);
}
@Override
String[] keys() {
return new String[] {
key0, key1, key2, key3, key4, key5, key6, key7, key8, key9, key10, key11, key12, key13, key14, key15
};
}
@Override
Object[] values() {
return new Object[] {
value0, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, value11, value12,
value13, value14, value15
};
}
@Override
void write(int index, String key, Object value) {
if (index < 4) {
switch (index) {
case 0:
key0 = key;
value0 = value;
break;
case 1:
key1 = key;
value1 = value;
break;
case 2:
key2 = key;
value2 = value;
break;
case 3:
key3 = key;
value3 = value;
break;
default:
throw new RuntimeException("Bug in code");
}
} else if (index < 8) {
switch (index) {
case 4:
key4 = key;
value4 = value;
break;
case 5:
key5 = key;
value5 = value;
break;
case 6:
key6 = key;
value6 = value;
break;
case 7:
key7 = key;
value7 = value;
break;
default:
throw new RuntimeException("Bug in code");
}
} else if (index < 12) {
switch (index) {
case 8:
key8 = key;
value8 = value;
break;
case 9:
key9 = key;
value9 = value;
break;
case 10:
key10 = key;
value10 = value;
break;
case 11:
key11 = key;
value11 = value;
break;
default:
throw new RuntimeException("Bug in code");
}
} else {
switch (index) {
case 12:
key12 = key;
value12 = value;
break;
case 13:
key13 = key;
value13 = value;
break;
case 14:
key14 = key;
value14 = value;
break;
case 15:
key15 = key;
value15 = value;
break;
default:
throw new IllegalArgumentException("Invalid index " + index);
}
}
}
@Override
Dictionary expand(String key, Object value) {
return new DictionaryMax(this, key, value);
}
@Override
int contractThreshold() {
return Dictionary11.CAPACITY;
}
@Override
Dictionary contract() {
return new Dictionary11(this);
}
@Override
public Dictionary copyOf() {
return new Dictionary16(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary2.java
================================================
package com.lambdazen.bitsy.ads.dict;
public class Dictionary2 extends PrimitiveDictionary implements Dictionary {
public static final int CAPACITY = 2;
String key0;
Object value0;
String key1;
Object value1;
// Expand constructor
public Dictionary2(Dictionary1 base, String key, Object value) {
this.key0 = base.key0;
this.value0 = base.value0;
// Last key
this.key1 = key;
this.value1 = value;
}
// Contract constructor
public Dictionary2(Dictionary3 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
}
// Copy constructor
public Dictionary2(Dictionary2 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
}
// FromMap constructor
public Dictionary2(String[] keys, Object[] values) {
this.key0 = lookupKey(keys, 0);
this.value0 = lookupValue(values, 0);
this.key1 = lookupKey(keys, 1);
this.value1 = lookupValue(values, 1);
}
@Override
String[] keys() {
return new String[] {key0, key1};
}
@Override
Object[] values() {
return new Object[] {value0, value1};
}
@Override
void write(int index, String key, Object value) {
switch (index) {
case 0:
key0 = key;
value0 = value;
break;
case 1:
key1 = key;
value1 = value;
break;
default:
throw new IllegalArgumentException("Invalid index " + index);
}
}
@Override
Dictionary expand(String key, Object value) {
return new Dictionary3(this, key, value);
}
@Override
int contractThreshold() {
return Dictionary1.CAPACITY;
}
@Override
Dictionary contract() {
return new Dictionary1(this);
}
@Override
public Dictionary copyOf() {
return new Dictionary2(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary3.java
================================================
package com.lambdazen.bitsy.ads.dict;
public class Dictionary3 extends PrimitiveDictionary implements Dictionary {
public static final int CAPACITY = 3;
String key0;
Object value0;
String key1;
Object value1;
String key2;
Object value2;
// Expand constructor
public Dictionary3(Dictionary2 base, String key, Object value) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
// Last key
this.key2 = key;
this.value2 = value;
}
// Contract constructor
public Dictionary3(Dictionary4 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
}
// Copy constructor
public Dictionary3(Dictionary3 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
}
// FromMap constructor
public Dictionary3(String[] keys, Object[] values) {
this.key0 = lookupKey(keys, 0);
this.value0 = lookupValue(values, 0);
this.key1 = lookupKey(keys, 1);
this.value1 = lookupValue(values, 1);
this.key2 = lookupKey(keys, 2);
this.value2 = lookupValue(values, 2);
}
@Override
String[] keys() {
return new String[] {key0, key1, key2};
}
@Override
Object[] values() {
return new Object[] {value0, value1, value2};
}
@Override
void write(int index, String key, Object value) {
switch (index) {
case 0:
key0 = key;
value0 = value;
break;
case 1:
key1 = key;
value1 = value;
break;
case 2:
key2 = key;
value2 = value;
break;
default:
throw new IllegalArgumentException("Invalid index " + index);
}
}
@Override
Dictionary expand(String key, Object value) {
return new Dictionary4(this, key, value);
}
@Override
int contractThreshold() {
return Dictionary2.CAPACITY;
}
@Override
Dictionary contract() {
return new Dictionary2(this);
}
@Override
public Dictionary copyOf() {
return new Dictionary3(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary4.java
================================================
package com.lambdazen.bitsy.ads.dict;
public class Dictionary4 extends PrimitiveDictionary implements Dictionary {
public static final int CAPACITY = 4;
String key0;
Object value0;
String key1;
Object value1;
String key2;
Object value2;
String key3;
Object value3;
// Expand constructor
public Dictionary4(Dictionary3 base, String key, Object value) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
// Last key
this.key3 = key;
this.value3 = value;
}
// Contract constructor
public Dictionary4(Dictionary6 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
}
// Copy constructor
public Dictionary4(Dictionary4 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
}
// FromMap constructor
public Dictionary4(String[] keys, Object[] values) {
this.key0 = lookupKey(keys, 0);
this.value0 = lookupValue(values, 0);
this.key1 = lookupKey(keys, 1);
this.value1 = lookupValue(values, 1);
this.key2 = lookupKey(keys, 2);
this.value2 = lookupValue(values, 2);
this.key3 = lookupKey(keys, 3);
this.value3 = lookupValue(values, 3);
}
@Override
String[] keys() {
return new String[] {key0, key1, key2, key3};
}
@Override
Object[] values() {
return new Object[] {value0, value1, value2, value3};
}
@Override
void write(int index, String key, Object value) {
switch (index) {
case 0:
key0 = key;
value0 = value;
break;
case 1:
key1 = key;
value1 = value;
break;
case 2:
key2 = key;
value2 = value;
break;
case 3:
key3 = key;
value3 = value;
break;
default:
throw new IllegalArgumentException("Invalid index " + index);
}
}
@Override
Dictionary expand(String key, Object value) {
return new Dictionary6(this, key, value);
}
@Override
int contractThreshold() {
return Dictionary3.CAPACITY;
}
@Override
Dictionary contract() {
return new Dictionary3(this);
}
@Override
public Dictionary copyOf() {
return new Dictionary4(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary6.java
================================================
package com.lambdazen.bitsy.ads.dict;
public class Dictionary6 extends PrimitiveDictionary implements Dictionary {
public static final int CAPACITY = 6;
String key0;
Object value0;
String key1;
Object value1;
String key2;
Object value2;
String key3;
Object value3;
String key4;
Object value4;
String key5;
Object value5;
// Expand constructor
public Dictionary6(Dictionary4 base, String key, Object value) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
// Last key
this.key4 = key;
this.value4 = value;
}
// Contract constructor
public Dictionary6(Dictionary8 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
}
// Copy constructor
public Dictionary6(Dictionary6 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
}
// FromMap constructor
public Dictionary6(String[] keys, Object[] values) {
this.key0 = lookupKey(keys, 0);
this.value0 = lookupValue(values, 0);
this.key1 = lookupKey(keys, 1);
this.value1 = lookupValue(values, 1);
this.key2 = lookupKey(keys, 2);
this.value2 = lookupValue(values, 2);
this.key3 = lookupKey(keys, 3);
this.value3 = lookupValue(values, 3);
this.key4 = lookupKey(keys, 4);
this.value4 = lookupValue(values, 4);
this.key5 = lookupKey(keys, 5);
this.value5 = lookupValue(values, 5);
}
@Override
String[] keys() {
return new String[] {key0, key1, key2, key3, key4, key5};
}
@Override
Object[] values() {
return new Object[] {value0, value1, value2, value3, value4, value5};
}
@Override
void write(int index, String key, Object value) {
switch (index) {
case 0:
key0 = key;
value0 = value;
break;
case 1:
key1 = key;
value1 = value;
break;
case 2:
key2 = key;
value2 = value;
break;
case 3:
key3 = key;
value3 = value;
break;
case 4:
key4 = key;
value4 = value;
break;
case 5:
key5 = key;
value5 = value;
break;
default:
throw new IllegalArgumentException("Invalid index " + index);
}
}
@Override
Dictionary expand(String key, Object value) {
return new Dictionary8(this, key, value);
}
@Override
int contractThreshold() {
return Dictionary4.CAPACITY;
}
@Override
Dictionary contract() {
return new Dictionary4(this);
}
@Override
public Dictionary copyOf() {
return new Dictionary6(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary8.java
================================================
package com.lambdazen.bitsy.ads.dict;
public class Dictionary8 extends PrimitiveDictionary implements Dictionary {
public static final int CAPACITY = 8;
String key0;
Object value0;
String key1;
Object value1;
String key2;
Object value2;
String key3;
Object value3;
String key4;
Object value4;
String key5;
Object value5;
String key6;
Object value6;
String key7;
Object value7;
// Expand constructor
public Dictionary8(Dictionary6 base, String key, Object value) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
// Last key
this.key6 = key;
this.value6 = value;
}
// Contract constructor
public Dictionary8(Dictionary11 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
this.key6 = base.key6;
this.value6 = base.value6;
this.key7 = base.key7;
this.value7 = base.value7;
}
// Copy constructor
public Dictionary8(Dictionary8 base) {
this.key0 = base.key0;
this.value0 = base.value0;
this.key1 = base.key1;
this.value1 = base.value1;
this.key2 = base.key2;
this.value2 = base.value2;
this.key3 = base.key3;
this.value3 = base.value3;
this.key4 = base.key4;
this.value4 = base.value4;
this.key5 = base.key5;
this.value5 = base.value5;
this.key6 = base.key6;
this.value6 = base.value6;
this.key7 = base.key7;
this.value7 = base.value7;
}
// FromMap constructor
public Dictionary8(String[] keys, Object[] values) {
this.key0 = lookupKey(keys, 0);
this.value0 = lookupValue(values, 0);
this.key1 = lookupKey(keys, 1);
this.value1 = lookupValue(values, 1);
this.key2 = lookupKey(keys, 2);
this.value2 = lookupValue(values, 2);
this.key3 = lookupKey(keys, 3);
this.value3 = lookupValue(values, 3);
this.key4 = lookupKey(keys, 4);
this.value4 = lookupValue(values, 4);
this.key5 = lookupKey(keys, 5);
this.value5 = lookupValue(values, 5);
this.key6 = lookupKey(keys, 6);
this.value6 = lookupValue(values, 6);
this.key7 = lookupKey(keys, 7);
this.value7 = lookupValue(values, 7);
}
@Override
String[] keys() {
return new String[] {key0, key1, key2, key3, key4, key5, key6, key7};
}
@Override
Object[] values() {
return new Object[] {value0, value1, value2, value3, value4, value5, value6, value7};
}
@Override
void write(int index, String key, Object value) {
if (index < 4) {
switch (index) {
case 0:
key0 = key;
value0 = value;
break;
case 1:
key1 = key;
value1 = value;
break;
case 2:
key2 = key;
value2 = value;
break;
case 3:
key3 = key;
value3 = value;
break;
default:
throw new RuntimeException("Bug in code");
}
} else {
switch (index) {
case 4:
key4 = key;
value4 = value;
break;
case 5:
key5 = key;
value5 = value;
break;
case 6:
key6 = key;
value6 = value;
break;
case 7:
key7 = key;
value7 = value;
break;
default:
throw new IllegalArgumentException("Invalid index " + index);
}
}
}
@Override
Dictionary expand(String key, Object value) {
return new Dictionary11(this, key, value);
}
@Override
int contractThreshold() {
return Dictionary6.CAPACITY;
}
@Override
Dictionary contract() {
return new Dictionary6(this);
}
@Override
public Dictionary copyOf() {
return new Dictionary8(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/DictionaryFactory.java
================================================
package com.lambdazen.bitsy.ads.dict;
import java.util.Map;
public class DictionaryFactory {
public static Dictionary fromMap(Map<String, Object> properties) {
if (properties == null) {
return null;
}
int size = properties.size();
String[] keys = new String[size];
Object[] values = new Object[size];
int counter = 0;
for (Map.Entry<String, Object> entry : properties.entrySet()) {
keys[counter] = entry.getKey();
values[counter] = entry.getValue();
counter++;
}
// assert counter == size;
if (size == 0) {
return null;
} else if (size <= 1) {
return new Dictionary1(keys[0], values[0]);
} else if (size <= 2) {
return new Dictionary2(keys, values);
} else if (size <= 3) {
return new Dictionary3(keys, values);
} else if (size <= 4) {
return new Dictionary4(keys, values);
} else if (size <= 6) {
return new Dictionary6(keys, values);
} else if (size <= 8) {
return new Dictionary8(keys, values);
} else if (size <= 11) {
return new Dictionary11(keys, values);
} else if (size <= 16) {
return new Dictionary16(keys, values);
} else {
return new DictionaryMax(keys, values);
}
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/DictionaryMax.java
================================================
package com.lambdazen.bitsy.ads.dict;
import java.util.Arrays;
public class DictionaryMax extends PrimitiveDictionary implements Dictionary {
int capacity;
String[] keys;
Object[] values;
// Expand constructor
public DictionaryMax(Dictionary16 base, String key, Object value) {
this.capacity = 24;
keys = Arrays.copyOf(base.keys(), capacity);
values = Arrays.copyOf(base.values(), capacity);
keys[16] = key;
values[16] = value;
}
// Copy constructor
public DictionaryMax(DictionaryMax base) {
this.capacity = base.capacity;
keys = Arrays.copyOf(base.keys(), capacity);
values = Arrays.copyOf(base.values(), capacity);
}
// FromMap constructor
public DictionaryMax(String[] keys, Object[] values) {
this.capacity = Math.max(24, keys.length + keys.length / 2);
this.keys = Arrays.copyOf(keys, capacity);
this.values = Arrays.copyOf(values, capacity);
}
@Override
String[] keys() {
return keys;
}
@Override
Object[] values() {
return values;
}
@Override
void write(int index, String key, Object value) {
keys[index] = key;
values[index] = value;
}
@Override
Dictionary expand(String key, Object value) {
int newCapacity = capacity + (capacity / 2);
keys = Arrays.copyOf(keys, newCapacity);
values = Arrays.copyOf(values, newCapacity);
keys[capacity] = key;
values[capacity] = value;
this.capacity = newCapacity;
return this;
}
@Override
int contractThreshold() {
return capacity / 2;
}
@Override
Dictionary contract() {
if (capacity < 14) {
// Move to Dictionary16
return new Dictionary16(this);
} else {
int newCapacity = capacity * 3 / 4;
keys = Arrays.copyOf(keys, newCapacity);
values = Arrays.copyOf(values, newCapacity);
this.capacity = newCapacity;
return this;
}
}
@Override
public Dictionary copyOf() {
return new DictionaryMax(this);
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/PrimitiveDictionary.java
================================================
package com.lambdazen.bitsy.ads.dict;
import com.lambdazen.bitsy.store.IStringCanonicalizer;
import java.util.Arrays;
public abstract class PrimitiveDictionary implements Dictionary {
public PrimitiveDictionary() {
// Nothing to do
}
abstract String[] keys();
abstract Object[] values();
abstract void write(int index, String key, Object value);
abstract Dictionary expand(String key, Object value);
abstract int contractThreshold();
abstract Dictionary contract();
public abstract Dictionary copyOf();
public int size() {
String[] keys = keys();
int i;
for (i = 0; i < keys.length; i++) {
if (keys[i] == null) {
break;
}
}
return i;
}
public String[] getPropertyKeys() {
String[] keys = keys();
int i;
for (i = 0; i < keys.length; i++) {
if (keys[i] == null) {
break;
}
}
return Arrays.copyOf(keys, i);
}
@Override
public Object getProperty(String key) {
String[] keys = keys();
Object[] values = values();
for (int i = 0; i < keys.length; i++) {
String curKey = keys[i];
if (curKey == null) {
// End of keys
return null;
} else if (curKey.equals(key)) {
return values[i];
}
}
return null;
}
@Override
public Dictionary setProperty(String key, Object value) {
String[] keys = keys();
Object[] values = values();
boolean overwroteValue = false;
int i;
for (i = 0; i < keys.length; i++) {
String curKey = keys[i];
if (curKey == null) {
// End of keys
break;
} else if (keys[i].equals(key)) {
values[i] = value;
write(i, keys[i], value);
overwroteValue = true;
}
}
if (overwroteValue) {
// Stick with this
return this;
} else {
if (i == keys.length) {
// Reached end, need to move up
return expand(key, value);
} else {
// Not yet at the end
write(i, key, value);
return this;
}
}
}
@Override
public void canonicalizeKeys(IStringCanonicalizer canonicalizer) {
String[] keys = keys();
Object[] values = null;
int i = 0;
for (i = 0; i < keys.length; i++) {
String origKey = keys[i];
String newKey = canonicalizer.canonicalize(origKey);
// Avoid step if already canonical
if (newKey != origKey) {
if (values == null) {
// Don't generate values unless required
values = values();
}
write(i, newKey, values[i]);
}
i++;
}
}
@Override
public Dictionary removeProperty(String key) {
String[] keys = keys();
Object[] values = values();
int overwritePos = -1;
int i;
for (i = 0; i < keys.length; i++) {
String curKey = keys[i];
if (curKey == null) {
// End of keys
break;
} else if (keys[i].equals(key)) {
overwritePos = i;
}
}
if (overwritePos == -1) {
// Couldn't find key
return this;
} else {
// Overwrite from end to here
int lastIdx = i - 1;
if (overwritePos != lastIdx) {
write(overwritePos, keys[lastIdx], values[lastIdx]);
}
write(lastIdx, null, null);
if (lastIdx <= contractThreshold()) {
// The new size is at or below the contract threshold
return contract();
} else {
return this;
}
}
}
protected String lookupKey(String[] keys, int i) {
return (i < keys.length) ? keys[i] : null;
}
protected Object lookupValue(Object[] values, int i) {
return (i < values.length) ? values[i] : null;
}
public String toString() {
StringBuilder ans = new StringBuilder("PrimitiveDictionary(size = " + size());
for (String key : getPropertyKeys()) {
ans.append(", " + key + ": " + getProperty(key));
}
ans.append(")");
return ans.toString();
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/set/ArraySet.java
================================================
package com.lambdazen.bitsy.ads.set;
import java.util.Arrays;
/**
* This class uses an array-based set implementation rather than SetMax and
* CompactMultiSetMax classes that implement a hash-based set. Neither
* implementation throws ConcurrentModificationException on reads, but expect
* writes to be serialized.
*/
public class ArraySet<T> implements Set<T> {
int size;
Object[] elements;
public ArraySet(Object[] elements) {
this(elements, elements.length);
}
protected ArraySet(Object[] elements, int size) {
this.size = size;
this.elements = new Object[size + size / 2];
for (int i = 0; i < size; i++) {
this.elements[i] = (T) elements[i];
}
}
@Override
public int size() {
return size;
}
@Override
public Object[] getElements() {
return Arrays.copyOf(elements, size);
}
@Override
public Object removeElement(T elem) {
// Go over elements and remove the one
for (int i = 0; i < size; i++) {
if (elem.equals(elements[i])) {
if (i < size - 1) {
elements[i] = elements[size - 1];
}
this.size--;
elements[size] = null;
break;
}
}
if (size < 16) {
return new Set24<T>(getElements());
} else if (size < elements.length / 2) {
// Using the constructor that cuts the size -- to avoid two array creations
return new ArraySet<T>(elements, size);
} else {
// Use the same object
return this;
}
}
@Override
public Set<T> addElement(T elem) {
for (int i = 0; i < size; i++) {
if (elem.equals(elements[i])) {
// Nothing to do
return this;
}
}
if (size < elements.length) {
elements[size] = elem;
this.size++;
return this;
} else {
Set<T> ans = new ArraySet<T>(elements);
ans.addElement(elem);
return ans;
}
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/set/ClassifierGetter.java
================================================
package com.lambdazen.bitsy.ads.set;
public interface ClassifierGetter<C, T> {
public C getClassifier(T obj);
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/set/CompactMultiSetMax.java
================================================
package com.lambdazen.bitsy.ads.set;
import java.util.ArrayList;
import java.util.List;
/**
* The compact multi-set takes an element and a classifier on that element. It
* supports a get that takes the classifier and returns the matches. This class
* is NOT thread-safe, but can support multiple readers as long as there is only
* one writer.
*
* This class is used for two purposes. The first is to store adjacency lists by
* label. The classifier picks up the label from the Edge. The second purpose is
* to provide SetMax with a thread-safe HashSet implementation.
*/
public class CompactMultiSetMax<C, T> {
public static final int MIN_TO_RESIZE = 8;
int occupied = 0;
boolean safe;
Object[] elements;
public CompactMultiSetMax(int initSize, boolean safe) {
this.elements = new Object[initSize];
this.occupied = 0;
this.safe = safe;
}
public int getOccupiedCells() {
return this.occupied;
}
public CompactMultiSetMax<C, T> add(T obj, ClassifierGetter<C, T> c) {
Object classifier = c.getClassifier(obj);
addElementNoRehash(classifier.hashCode(), obj);
int len = elements.length;
if (occupied >= len - (len / 4)) { // 0.75 load factor
return rehash(len * 2, c);
} else {
return this;
}
}
protected void addElementNoRehash(int hashCode, T obj) {
int index = (hashCode & 0x7FFFFFFF) % elements.length;
if (elements[index] == null) {
occupied++;
}
if (safe) {
elements[index] = CompactSet.<T>addSafe(elements[index], obj);
} else {
elements[index] = CompactSet.<T>add(elements[index], obj);
}
}
private CompactMultiSetMax<C, T> rehash(int newLength, ClassifierGetter<C, T> c) {
CompactMultiSetMax<C, T> ans = new CompactMultiSetMax<C, T>(newLength, safe); // use the same safe boolean
for (Object elem : elements) {
for (Object item : CompactSet.getElements(elem)) {
Object classifier = c.getClassifier((T) item);
ans.addElementNoRehash(classifier.hashCode(), (T) item);
}
}
return ans;
}
public CompactMultiSetMax<C, T> remove(T obj, ClassifierGetter<C, T> c) {
Object classifier = c.getClassifier(obj);
removeElementNoHash(classifier.hashCode(), obj);
int len = elements.length;
if ((occupied > MIN_TO_RESIZE) && (occupied < len / 2)) {
return rehash(len / 2, c);
} else {
return this;
}
}
protected void removeElementNoHash(int hashCode, T obj) {
int index = (hashCode & 0x7FFFFFFF) % elements.length;
Object oldVal = elements[index];
if (oldVal == null) {
return;
} else {
Object newVal = CompactSet.<T>remove(oldVal, obj);
elements[index] = newVal;
if (newVal == null) {
occupied--;
}
}
}
/*
* Returns a CompactSet-compatible object with the given classifier. Note that
* extra elements could be returned -- hence "super set". It is the
* responsibility of the caller to weed these out
*/
public Object[] getSuperSetWithClassifier(C key) {
if (key == null) {
return getAllElements();
} else {
int index = (key.hashCode() & 0x7FFFFFFF) % elements.length;
return CompactSet.getElements(elements[index]);
}
}
public Object[] getAllElements() {
List<Object> ans = new ArrayList<Object>();
for (int i = 0; i < elements.length; i++) {
Object elem = elements[i];
for (Object item : CompactSet.getElements(elem)) {
if (item != null) {
// This check is needed because item could be null when
// dealing with lock-free reads that occur during a write.
// The system will retry the read based on the sequence
// number -- the important thing is to
// not throw an exception
ans.add(item);
}
}
}
return ans.toArray();
}
// This method goes over the elements to see if this compact set can be fit inside a Set24
public boolean sizeBiggerThan24() {
int currentSize = 0;
for (int i = 0; i < elements.length; i++) {
Object elem = elements[i];
if (elem == null) {
// Empty cell
continue;
} else if (elem instanceof ArraySet) {
// Don't reorg till the ArraySet reduces to Set24
return true;
} else if (elem instanceof SetMax) {
// Don't reorg till the SetMax reduces to Set24
return true;
} else {
currentSize += CompactSet.size(elem);
}
if (currentSize > 24) {
return true;
}
}
return false;
}
}
================================================
FILE: src/main/java/com/lambdazen/bitsy/ads/set/CompactSet.java
===================================
gitextract_xh4rv3j8/
├── .classpath
├── .git-blame-ignore-revs
├── .github/
│ ├── dependabot.yml
│ └── workflows/
│ └── ci.yml
├── .gitignore
├── .mvn/
│ └── wrapper/
│ └── maven-wrapper.properties
├── .project
├── .settings/
│ └── org.eclipse.jdt.core.prefs
├── LICENSE
├── NOTICE
├── README.md
├── mvnw
├── mvnw.cmd
├── pom.xml
└── src/
├── main/
│ ├── java/
│ │ └── com/
│ │ └── lambdazen/
│ │ └── bitsy/
│ │ ├── BitsyEdge.java
│ │ ├── BitsyElement.java
│ │ ├── BitsyErrorCodes.java
│ │ ├── BitsyException.java
│ │ ├── BitsyFeatures.java
│ │ ├── BitsyGraph.java
│ │ ├── BitsyGraphMBean.java
│ │ ├── BitsyGraphSONModule.java
│ │ ├── BitsyIoRegistryV3d0.java
│ │ ├── BitsyIsolationLevel.java
│ │ ├── BitsyProperty.java
│ │ ├── BitsyRetryException.java
│ │ ├── BitsyState.java
│ │ ├── BitsyVertex.java
│ │ ├── BitsyVertexProperty.java
│ │ ├── ICommitChanges.java
│ │ ├── IEdge.java
│ │ ├── IGraphStore.java
│ │ ├── ITransaction.java
│ │ ├── PortDatabase.java
│ │ ├── ThreadedBitsyGraph.java
│ │ ├── UUID.java
│ │ ├── UUIDGraphBinarySerializer.java
│ │ ├── ads/
│ │ │ ├── dict/
│ │ │ │ ├── Dictionary.java
│ │ │ │ ├── Dictionary1.java
│ │ │ │ ├── Dictionary11.java
│ │ │ │ ├── Dictionary16.java
│ │ │ │ ├── Dictionary2.java
│ │ │ │ ├── Dictionary3.java
│ │ │ │ ├── Dictionary4.java
│ │ │ │ ├── Dictionary6.java
│ │ │ │ ├── Dictionary8.java
│ │ │ │ ├── DictionaryFactory.java
│ │ │ │ ├── DictionaryMax.java
│ │ │ │ └── PrimitiveDictionary.java
│ │ │ └── set/
│ │ │ ├── ArraySet.java
│ │ │ ├── ClassifierGetter.java
│ │ │ ├── CompactMultiSetMax.java
│ │ │ ├── CompactSet.java
│ │ │ ├── PrimitiveSet.java
│ │ │ ├── Set.java
│ │ │ ├── Set12.java
│ │ │ ├── Set2.java
│ │ │ ├── Set24.java
│ │ │ ├── Set3.java
│ │ │ ├── Set4.java
│ │ │ ├── Set6.java
│ │ │ ├── Set8.java
│ │ │ └── SetMax.java
│ │ ├── gremlin/
│ │ │ ├── BitsyGraphStep.java
│ │ │ └── BitsyTraversalStrategy.java
│ │ ├── index/
│ │ │ ├── BitsyIndex.java
│ │ │ ├── BitsyIndexMap.java
│ │ │ ├── EdgeIndex.java
│ │ │ ├── EdgeIndexMap.java
│ │ │ ├── IndexHelper.java
│ │ │ ├── VertexIndex.java
│ │ │ └── VertexIndexMap.java
│ │ ├── jsr223/
│ │ │ └── BitsyGremlinPlugin.java
│ │ ├── store/
│ │ │ ├── AdjacencyMap.java
│ │ │ ├── AdjacencyMapForBeans.java
│ │ │ ├── BackupJob.java
│ │ │ ├── CompactAndCopyTask.java
│ │ │ ├── EdgeBean.java
│ │ │ ├── EdgeBeanJson.java
│ │ │ ├── Endpoint.java
│ │ │ ├── FileBackedMemoryGraphStore.java
│ │ │ ├── IEdgeRemover.java
│ │ │ ├── IStringCanonicalizer.java
│ │ │ ├── ITxBatchJob.java
│ │ │ ├── IVeReorgJob.java
│ │ │ ├── IndexBean.java
│ │ │ ├── JobWithCountDownLatch.java
│ │ │ ├── LoadTask.java
│ │ │ ├── MemoryGraphStore.java
│ │ │ ├── ParallelRecordReader.java
│ │ │ ├── Record.java
│ │ │ ├── RecordReader.java
│ │ │ ├── SingleThreadedStringCanonicalizer.java
│ │ │ ├── TxBatch.java
│ │ │ ├── TxLog.java
│ │ │ ├── TxLogFlushPotential.java
│ │ │ ├── TxUnit.java
│ │ │ ├── VEObsolescencePotential.java
│ │ │ ├── VertexBean.java
│ │ │ └── VertexBeanJson.java
│ │ ├── tx/
│ │ │ ├── BitsyTransaction.java
│ │ │ └── BitsyTransactionContext.java
│ │ ├── util/
│ │ │ ├── BitsyElementIterator.java
│ │ │ ├── BufferFlusher.java
│ │ │ ├── BufferPotential.java
│ │ │ ├── BufferQueuer.java
│ │ │ ├── CommittableFileLog.java
│ │ │ ├── DefaultCommitChanges.java
│ │ │ ├── DoubleBuffer.java
│ │ │ ├── DoubleBufferThread.java
│ │ │ ├── DoubleBufferWithExecWork.java
│ │ │ ├── EdgeIterator.java
│ │ │ └── VertexIterator.java
│ │ └── wrapper/
│ │ ├── BitsyAutoReloadingEdge.java
│ │ ├── BitsyAutoReloadingGraph.java
│ │ └── BitsyAutoReloadingVertex.java
│ └── resources/
│ └── META-INF/
│ └── services/
│ └── org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin
└── test/
├── java/
│ └── com/
│ └── lambdazen/
│ └── bitsy/
│ ├── BitsyGraphIT.java
│ ├── BitsyMemGraphIT.java
│ ├── FileBasedTestCase.java
│ ├── RecoveryTest.java
│ ├── ads/
│ │ ├── dict/
│ │ │ └── DictionaryTest.java
│ │ └── set/
│ │ ├── CompactMultiSetMaxTest.java
│ │ └── SetTest.java
│ ├── store/
│ │ ├── EndpointTest.java
│ │ ├── FileBackedMemoryGraphStoreTest.java
│ │ ├── MemoryGraphStoreTest.java
│ │ ├── RecordTest.java
│ │ └── SingleThreadedStringCanonicalizerTest.java
│ ├── structure/
│ │ ├── BitsyGraphStructureTestSuite.java
│ │ ├── BitsyProcessStandardTestSuite.java
│ │ ├── BitsyTestGraphProvider.java
│ │ └── HasLabelTest.java
│ └── util/
│ ├── CommittableFileLogTest.java
│ └── DoubleBufferIT.java
└── resources/
├── com/
│ └── lambdazen/
│ └── bitsy/
│ └── util/
│ └── mobydick.txt
├── gremlin-server/
│ ├── bitsy.properties
│ └── gremlin-server-bitsy.yaml
└── recovery/
├── stage1/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage2/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage3/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage4/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage5/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
├── stage6/
│ ├── eA.txt
│ ├── eB.txt
│ ├── metaA.txt
│ ├── metaB.txt
│ ├── txA.txt
│ ├── txB.txt
│ ├── vA.txt
│ └── vB.txt
└── stage7/
├── eA.txt
├── eB.txt
├── metaA.txt
├── metaB.txt
├── txA.txt
├── txB.txt
├── vA.txt
└── vB.txt
SYMBOL INDEX (1176 symbols across 120 files)
FILE: src/main/java/com/lambdazen/bitsy/BitsyEdge.java
class BitsyEdge (line 17) | public class BitsyEdge extends BitsyElement implements Edge, IEdge {
method BitsyEdge (line 21) | public BitsyEdge(
method BitsyEdge (line 40) | public BitsyEdge(EdgeBean bean, BitsyTransaction tx, BitsyState state) {
method asJsonBean (line 52) | public EdgeBeanJson asJsonBean() {
method vertices (line 57) | @Override
method inVertex (line 70) | @Override
method outVertex (line 77) | @Override
method bothVertices (line 84) | @Override
method inOrOutVertex (line 93) | private Vertex inOrOutVertex(Direction dir) {
method getInVertexId (line 107) | public UUID getInVertexId() {
method getOutVertexId (line 111) | public UUID getOutVertexId() {
method getVertexId (line 115) | public UUID getVertexId(Direction dir) {
method incrementVersion (line 125) | public void incrementVersion() {
method remove (line 129) | public void remove() {
method toString (line 133) | public String toString() {
method properties (line 137) | @Override
FILE: src/main/java/com/lambdazen/bitsy/BitsyElement.java
class BitsyElement (line 17) | public abstract class BitsyElement implements Element {
type PropType (line 18) | public static enum PropType {
method BitsyElement (line 32) | public BitsyElement(
method id (line 43) | @Override
method label (line 49) | @Override
method graph (line 55) | @Override
method getPropertyDict (line 60) | public Dictionary getPropertyDict() {
method value (line 64) | @Override
method keys (line 75) | @Override
method removeProperty (line 86) | public <T> T removeProperty(String key) {
method property (line 100) | @Override
method property (line 133) | @Override
method properties (line 144) | @Override
method markForUpdate (line 161) | public void markForUpdate() {
method remove (line 174) | @Override
method getState (line 177) | public BitsyState getState() {
method setState (line 181) | public void setState(BitsyState state) {
method getVersion (line 185) | public int getVersion() {
method getTransaction (line 189) | public ITransaction getTransaction() {
method hashCode (line 194) | @Override
method equals (line 199) | @Override
FILE: src/main/java/com/lambdazen/bitsy/BitsyErrorCodes.java
type BitsyErrorCodes (line 3) | public enum BitsyErrorCodes {
method toString (line 5) | public String toString() {
method toString (line 11) | public String toString() {
method toString (line 17) | public String toString() {
method toString (line 23) | public String toString() {
method toString (line 29) | public String toString() {
method toString (line 35) | public String toString() {
method toString (line 41) | public String toString() {
method toString (line 47) | public String toString() {
method toString (line 53) | public String toString() {
method toString (line 59) | public String toString() {
method toString (line 65) | public String toString() {
method toString (line 71) | public String toString() {
method toString (line 77) | public String toString() {
method toString (line 83) | public String toString() {
method toString (line 89) | public String toString() {
method toString (line 95) | public String toString() {
method toString (line 101) | public String toString() {
method toString (line 107) | public String toString() {
method toString (line 113) | public String toString() {
method toString (line 119) | public String toString() {
method toString (line 125) | public String toString() {
method toString (line 131) | public String toString() {
method toString (line 137) | public String toString() {
method toString (line 143) | public String toString() {
method toString (line 149) | public String toString() {
method toString (line 155) | public String toString() {
method toString (line 161) | public String toString() {
method toString (line 167) | public String toString() {
method toString (line 173) | public String toString() {
method toString (line 179) | public String toString() {
method toString (line 185) | public String toString() {
method toString (line 191) | public String toString() {
method toString (line 197) | public String toString() {
method toString (line 203) | public String toString() {
method toString (line 209) | public String toString() {
method toString (line 214) | public String toString() {
method toString (line 219) | public String toString() {
method toString (line 225) | public String toString() {
FILE: src/main/java/com/lambdazen/bitsy/BitsyException.java
class BitsyException (line 3) | public class BitsyException extends RuntimeException {
method BitsyException (line 7) | public BitsyException(BitsyErrorCodes code) {
method BitsyException (line 13) | public BitsyException(BitsyErrorCodes code, String s) {
method BitsyException (line 19) | public BitsyException(BitsyErrorCodes code, String s, Throwable t) {
method getErrorCode (line 25) | public BitsyErrorCodes getErrorCode() {
FILE: src/main/java/com/lambdazen/bitsy/BitsyFeatures.java
class BitsyFeatures (line 6) | public class BitsyFeatures implements Features {
method BitsyFeatures (line 15) | public BitsyFeatures(boolean isPersistent) {
method graph (line 19) | @Override
method edge (line 24) | @Override
method vertex (line 29) | @Override
method toString (line 34) | @Override
class BitsyGraphFeatures (line 39) | public class BitsyGraphFeatures implements Features.GraphFeatures {
method supportsComputer (line 42) | @Override
method variables (line 47) | @Override
method supportsPersistence (line 52) | @Override
method supportsThreadedTransactions (line 61) | @Override
class BitsyVariableFeatures (line 67) | public class BitsyVariableFeatures implements Features.VariableFeatures {
method supportsVariables (line 68) | @Override
method supportsBooleanValues (line 73) | @Override
method supportsDoubleValues (line 78) | @Override
method supportsFloatValues (line 83) | @Override
method supportsIntegerValues (line 88) | @Override
method supportsLongValues (line 93) | @Override
method supportsMapValues (line 98) | @Override
method supportsMixedListValues (line 103) | @Override
method supportsByteValues (line 108) | @Override
method supportsBooleanArrayValues (line 113) | @Override
method supportsByteArrayValues (line 118) | @Override
method supportsDoubleArrayValues (line 123) | @Override
method supportsFloatArrayValues (line 128) | @Override
method supportsIntegerArrayValues (line 133) | @Override
method supportsLongArrayValues (line 138) | @Override
method supportsSerializableValues (line 143) | @Override
method supportsStringValues (line 148) | @Override
method supportsUniformListValues (line 153) | @Override
method supportsStringArrayValues (line 158) | @Override
class BitsyVertexFeatures (line 164) | public class BitsyVertexFeatures implements Features.VertexFeatures {
method properties (line 167) | @Override
method supportsMetaProperties (line 172) | @Override
method supportsMultiProperties (line 177) | @Override
method supportsUserSuppliedIds (line 182) | @Override
method supportsNumericIds (line 187) | @Override
method supportsAnyIds (line 192) | @Override
class BitsyEdgeFeatures (line 200) | public class BitsyEdgeFeatures implements Features.EdgeFeatures {
method properties (line 203) | @Override
method supportsUserSuppliedIds (line 208) | @Override
method supportsNumericIds (line 213) | @Override
method supportsAnyIds (line 218) | @Override
class BitsyGraphPropertyFeatures (line 226) | public class BitsyGraphPropertyFeatures implements Features.VertexProp...
method supportsCustomIds (line 227) | @Override
method supportsUserSuppliedIds (line 232) | @Override
method supportsAnyIds (line 237) | @Override
method supportsNumericIds (line 242) | @Override
method supportsStringIds (line 247) | @Override
method supportsUuidIds (line 252) | @Override
FILE: src/main/java/com/lambdazen/bitsy/BitsyGraph.java
class BitsyGraph (line 34) | @Graph.OptIn("com.lambdazen.bitsy.structure.BitsyGraphStructureTestSuite")
method BitsyGraph (line 87) | protected BitsyGraph(char isThreaded, boolean allowFullGraphScans) {
method BitsyGraph (line 92) | public BitsyGraph() {
method BitsyGraph (line 96) | public BitsyGraph(boolean allowFullGraphScans) {
method BitsyGraph (line 100) | public BitsyGraph(Path dbPath) {
method BitsyGraph (line 111) | public BitsyGraph(Path dbPath, boolean allowFullGraphScans, long txLog...
method BitsyGraph (line 123) | public BitsyGraph(
method BitsyGraph (line 192) | public BitsyGraph(Configuration configuration) {
method createIndices (line 214) | private void createIndices(Class elemType, String vertexIndices) {
method open (line 228) | public static final BitsyGraph open(Configuration configuration) {
method toString (line 232) | public String toString() {
method isTransactionActive (line 241) | public boolean isTransactionActive() {
method isPersistent (line 247) | public boolean isPersistent() {
method isFullGraphScanAllowed (line 251) | public boolean isFullGraphScanAllowed() {
method getDefaultIsolationLevel (line 255) | public BitsyIsolationLevel getDefaultIsolationLevel() {
method setDefaultIsolationLevel (line 259) | public void setDefaultIsolationLevel(BitsyIsolationLevel level) {
method getTxIsolationLevel (line 263) | public BitsyIsolationLevel getTxIsolationLevel() {
method setTxIsolationLevel (line 267) | public void setTxIsolationLevel(BitsyIsolationLevel level) {
method getReorgFactor (line 271) | public double getReorgFactor() {
method setReorgFactor (line 283) | public void setReorgFactor(double factor) {
method getMinLinesPerReorg (line 293) | public int getMinLinesPerReorg() {
method setMinLinesPerReorg (line 305) | public void setMinLinesPerReorg(int minLinesPerReorg) {
method getTxLogThreshold (line 315) | public long getTxLogThreshold() {
method setTxLogThreshold (line 327) | public void setTxLogThreshold(long txLogThreshold) {
method flushTxLog (line 338) | public void flushTxLog() {
method backup (line 352) | public void backup(String pathToDir) {
method backup (line 360) | public void backup(Path pathToDir) {
method getTx (line 370) | protected BitsyTransaction getTx() {
method tx (line 389) | @Override
method compute (line 395) | @Override
method compute (line 401) | @Override
method io (line 407) | @Override
method features (line 415) | @Override
method configuration (line 421) | @Override
method validateHomogenousIds (line 441) | private void validateHomogenousIds(final Object[] ids) {
method addVertex (line 452) | @Override
method vertices (line 498) | @Override
method getVertex (line 528) | private Vertex getVertex(Object id) {
method getEdge (line 557) | private Edge getEdge(Object id) {
method edges (line 583) | public Iterator<Edge> edges(Object... edgeIds) {
method shutdown (line 613) | public void shutdown() {
method createKeyIndex (line 649) | public <T extends Element> void createKeyIndex(String key, Class<T> el...
method dropKeyIndex (line 653) | public <T extends Element> void dropKeyIndex(String key, Class<T> elem...
method getIndexedKeys (line 657) | public <T extends Element> Set<String> getIndexedKeys(Class<T> element...
method verticesByIndex (line 661) | public Iterator<BitsyVertex> verticesByIndex(final String key, final O...
method edgesByIndex (line 667) | public Iterator<BitsyEdge> edgesByIndex(final String key, final Object...
method getStore (line 673) | public IGraphStore getStore() {
method close (line 677) | @Override
method variables (line 682) | @Override
FILE: src/main/java/com/lambdazen/bitsy/BitsyGraphMBean.java
type BitsyGraphMBean (line 3) | public interface BitsyGraphMBean {
method getReorgFactor (line 10) | public double getReorgFactor();
method setReorgFactor (line 16) | public void setReorgFactor(double factor);
method getMinLinesPerReorg (line 23) | public int getMinLinesPerReorg();
method setMinLinesPerReorg (line 29) | public void setMinLinesPerReorg(int minLinesPerReorg);
method getTxLogThreshold (line 36) | public long getTxLogThreshold();
method setTxLogThreshold (line 43) | public void setTxLogThreshold(long txLogThreshold);
method flushTxLog (line 46) | public void flushTxLog();
method backup (line 52) | public void backup(String pathToDir);
FILE: src/main/java/com/lambdazen/bitsy/BitsyGraphSONModule.java
class BitsyGraphSONModule (line 35) | public class BitsyGraphSONModule extends TinkerPopJacksonModule {
method BitsyGraphSONModule (line 48) | private BitsyGraphSONModule() {
method getInstance (line 59) | public static final BitsyGraphSONModule getInstance() {
method getTypeDefinitions (line 63) | @Override
method getTypeNamespace (line 68) | @Override
class UUIDSerializer (line 73) | public static class UUIDSerializer extends StdSerializer<UUID> {
method UUIDSerializer (line 75) | public UUIDSerializer() {
method serialize (line 79) | @Override
method serializeWithType (line 87) | @Override
class UUIDDeserializer (line 103) | public static class UUIDDeserializer extends StdDeserializer<UUID> {
method UUIDDeserializer (line 104) | public UUIDDeserializer() {
method deserialize (line 108) | @Override
FILE: src/main/java/com/lambdazen/bitsy/BitsyIoRegistryV3d0.java
class BitsyIoRegistryV3d0 (line 14) | public class BitsyIoRegistryV3d0 extends AbstractIoRegistry {
method BitsyIoRegistryV3d0 (line 17) | private BitsyIoRegistryV3d0() {
method instance (line 31) | public static BitsyIoRegistryV3d0 instance() {
class UUIDGryoSerializer (line 35) | static final class UUIDGryoSerializer extends Serializer<UUID> {
method write (line 36) | @Override
method read (line 42) | @Override
FILE: src/main/java/com/lambdazen/bitsy/BitsyIsolationLevel.java
type BitsyIsolationLevel (line 3) | public enum BitsyIsolationLevel {
FILE: src/main/java/com/lambdazen/bitsy/BitsyProperty.java
class BitsyProperty (line 9) | public class BitsyProperty<T> implements Property<T> {
method BitsyProperty (line 15) | public BitsyProperty(BitsyElement element, String key, T value) {
method key (line 21) | @Override
method value (line 26) | @Override
method isPresent (line 35) | @Override
method element (line 40) | @Override
method remove (line 45) | @Override
method hashCode (line 54) | @Override
method equals (line 59) | @Override
method toString (line 64) | public String toString() {
FILE: src/main/java/com/lambdazen/bitsy/BitsyRetryException.java
class BitsyRetryException (line 3) | public class BitsyRetryException extends BitsyException {
method BitsyRetryException (line 7) | public BitsyRetryException(BitsyErrorCodes code) {
method BitsyRetryException (line 11) | public BitsyRetryException(BitsyErrorCodes code, String s) {
method BitsyRetryException (line 15) | public BitsyRetryException(BitsyErrorCodes code, String s, Throwable t) {
FILE: src/main/java/com/lambdazen/bitsy/BitsyState.java
type BitsyState (line 3) | public enum BitsyState {
FILE: src/main/java/com/lambdazen/bitsy/BitsyVertex.java
class BitsyVertex (line 19) | public class BitsyVertex extends BitsyElement implements Vertex {
method BitsyVertex (line 22) | public BitsyVertex(
method BitsyVertex (line 27) | public BitsyVertex(VertexBean bean, BitsyTransaction tx, BitsyState st...
method label (line 31) | @Override
method edges (line 37) | @Override
method asBean (line 42) | public VertexBean asBean() {
method asBean (line 47) | public VertexBean asBean(IStringCanonicalizer canonicalizer) {
method asJsonBean (line 55) | public VertexBeanJson asJsonBean() {
method vertices (line 61) | @Override
method incrementVersion (line 80) | public void incrementVersion() {
method remove (line 85) | public void remove() {
method addEdge (line 89) | @Override
method toString (line 139) | public String toString() {
method property (line 144) | @Override
method property (line 154) | @Override
method property (line 160) | @Override
method properties (line 177) | @Override
FILE: src/main/java/com/lambdazen/bitsy/BitsyVertexProperty.java
class BitsyVertexProperty (line 11) | public class BitsyVertexProperty<V> extends BitsyProperty<V> implements ...
method BitsyVertexProperty (line 12) | public BitsyVertexProperty(final BitsyVertex vertex, final String key,...
method keys (line 16) | @Override
method property (line 21) | @Override
method property (line 26) | @Override
method element (line 31) | @Override
method properties (line 36) | @Override
method id (line 41) | @Override
method toString (line 46) | public String toString() {
FILE: src/main/java/com/lambdazen/bitsy/ICommitChanges.java
type ICommitChanges (line 5) | public interface ICommitChanges {
method getVertexChanges (line 6) | public Collection<BitsyVertex> getVertexChanges();
method getEdgeChanges (line 8) | public Collection<BitsyEdge> getEdgeChanges();
FILE: src/main/java/com/lambdazen/bitsy/IEdge.java
type IEdge (line 3) | public interface IEdge {
method getInVertexId (line 4) | public UUID getInVertexId();
method getOutVertexId (line 6) | public UUID getOutVertexId();
FILE: src/main/java/com/lambdazen/bitsy/IGraphStore.java
type IGraphStore (line 12) | public interface IGraphStore {
method commit (line 13) | public void commit(ICommitChanges changes);
method getVertex (line 16) | public VertexBean getVertex(UUID id);
method getBitsyVertex (line 19) | public BitsyVertex getBitsyVertex(BitsyTransaction tx, UUID id);
method getEdge (line 22) | public EdgeBean getEdge(UUID id);
method getBitsyEdge (line 25) | public BitsyEdge getBitsyEdge(BitsyTransaction tx, UUID id);
method getEdges (line 27) | public List<EdgeBean> getEdges(UUID vertexId, Direction dir, String[] ...
method getAllVertices (line 29) | public Collection<VertexBean> getAllVertices();
method getAllEdges (line 31) | public Collection<EdgeBean> getAllEdges();
method createKeyIndex (line 33) | public <T extends Element> void createKeyIndex(String key, Class<T> el...
method dropKeyIndex (line 35) | public <T extends Element> void dropKeyIndex(String key, Class<T> elem...
method getIndexedKeys (line 37) | public <T extends Element> Set<String> getIndexedKeys(Class<T> element...
method shutdown (line 39) | public void shutdown();
method lookupVertices (line 41) | public Collection<VertexBean> lookupVertices(String key, Object value);
method lookupEdges (line 43) | public Collection<EdgeBean> lookupEdges(String key, Object value);
method allowFullGraphScans (line 45) | public boolean allowFullGraphScans();
FILE: src/main/java/com/lambdazen/bitsy/ITransaction.java
type ITransaction (line 9) | public interface ITransaction extends Transaction {
method save (line 10) | public void save(boolean commit);
method validateForQuery (line 12) | public void validateForQuery(BitsyElement bitsyElement) throws BitsyEx...
method getVertex (line 14) | public Vertex getVertex(UUID outVertexId) throws BitsyException;
method getEdge (line 16) | public Edge getEdge(UUID id) throws BitsyException;
method getEdges (line 18) | public Iterable<Edge> getEdges(BitsyVertex bitsyVertex, Direction dir,...
method markForPropertyUpdate (line 20) | public void markForPropertyUpdate(BitsyElement bitsyElement) throws Bi...
method addVertex (line 22) | public void addVertex(BitsyVertex vertex) throws BitsyException;
method removeVertex (line 24) | public void removeVertex(BitsyVertex vertex) throws BitsyException;
method addEdge (line 26) | public void addEdge(BitsyEdge edge) throws BitsyException;
method removeEdge (line 28) | public void removeEdge(BitsyEdge edge) throws BitsyException;
method getAllVertices (line 30) | public Iterator<Vertex> getAllVertices();
method getAllEdges (line 32) | public Iterator<Edge> getAllEdges();
method lookupVertices (line 34) | public Iterator<BitsyVertex> lookupVertices(String key, Object value);
method lookupEdges (line 36) | public Iterator<BitsyEdge> lookupEdges(String key, Object value);
method getIsolationLevel (line 38) | public BitsyIsolationLevel getIsolationLevel();
method setIsolationLevel (line 40) | public void setIsolationLevel(BitsyIsolationLevel level);
FILE: src/main/java/com/lambdazen/bitsy/PortDatabase.java
class PortDatabase (line 19) | public class PortDatabase {
method PortDatabase (line 32) | public PortDatabase(String[] args) throws IOException {
method portDatabase (line 101) | private void portDatabase() throws IOException {
method getVersion (line 150) | private String getVersion(Path sourcePath) throws IOException {
method getVersionFromPath (line 180) | public String getVersionFromPath(Path metaPath) throws IOException {
method setError (line 218) | private void setError(String error) {
method getError (line 222) | private String getError() {
method printUsage (line 226) | private static void printUsage(String error) {
method main (line 235) | public static void main(String[] args) {
method toHex (line 252) | private static String toHex(int input) {
type Converter (line 261) | public interface Converter {
method convert (line 262) | public String convert(String line, int lineNo, String fileName);
class V10ToV15Coverter (line 265) | public class V10ToV15Coverter implements Converter {
method convert (line 268) | @Override
class V15ToV10Coverter (line 289) | public class V15ToV10Coverter implements Converter {
method convert (line 292) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ThreadedBitsyGraph.java
class ThreadedBitsyGraph (line 6) | public class ThreadedBitsyGraph extends BitsyGraph {
method ThreadedBitsyGraph (line 10) | public ThreadedBitsyGraph(BitsyGraph g) {
method toString (line 18) | public String toString() {
method features (line 22) | @Override
method getTx (line 27) | @Override
method isTransactionActive (line 41) | @Override
method getDefaultIsolationLevel (line 47) | public BitsyIsolationLevel getDefaultIsolationLevel() {
method setDefaultIsolationLevel (line 51) | public void setDefaultIsolationLevel(BitsyIsolationLevel level) {
method getTxIsolationLevel (line 55) | public BitsyIsolationLevel getTxIsolationLevel() {
method setTxIsolationLevel (line 59) | public void setTxIsolationLevel(BitsyIsolationLevel level) {
method shutdown (line 63) | @Override
FILE: src/main/java/com/lambdazen/bitsy/UUID.java
class UUID (line 6) | public class UUID implements Comparable<UUID> {
method UUID (line 16) | public UUID(long msb, long lsb) {
method getMostSignificantBits (line 21) | @JsonIgnore
method getLeastSignificantBits (line 26) | @JsonIgnore
method toString (line 31) | public String toString() {
method uuidRepr (line 35) | public String uuidRepr() {
method fromString (line 39) | public static UUID fromString(String str) {
method randomUUID (line 45) | public static UUID randomUUID() {
method compareTo (line 51) | public int compareTo(UUID other) {
method hashCode (line 65) | @Override
method equals (line 72) | @Override
method toString (line 89) | public static String toString(UUID obj) {
FILE: src/main/java/com/lambdazen/bitsy/UUIDGraphBinarySerializer.java
class UUIDGraphBinarySerializer (line 10) | public class UUIDGraphBinarySerializer implements CustomTypeSerializer<U...
method getTypeName (line 14) | @Override
method getDataType (line 19) | @Override
method read (line 24) | @Override
method readValue (line 35) | @Override
method write (line 61) | @Override
method writeValue (line 69) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary.java
type Dictionary (line 9) | public interface Dictionary {
method size (line 10) | public int size();
method getProperty (line 12) | public Object getProperty(String key);
method getPropertyKeys (line 14) | public String[] getPropertyKeys();
method setProperty (line 16) | public Dictionary setProperty(String key, Object value);
method removeProperty (line 18) | public Dictionary removeProperty(String key);
method copyOf (line 20) | public Dictionary copyOf();
method canonicalizeKeys (line 24) | public void canonicalizeKeys(IStringCanonicalizer canonicalizer);
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary1.java
class Dictionary1 (line 4) | public class Dictionary1 extends PrimitiveDictionary implements Dictiona...
method Dictionary1 (line 11) | public Dictionary1(String key, Object value) {
method Dictionary1 (line 17) | public Dictionary1(Dictionary2 base) {
method Dictionary1 (line 23) | public Dictionary1(Dictionary1 base) {
method keys (line 28) | @Override
method values (line 33) | @Override
method copyOf (line 38) | @Override
method contractThreshold (line 43) | protected int contractThreshold() {
method contract (line 47) | protected Dictionary contract() {
method expand (line 51) | protected Dictionary expand(String key, Object value) {
method write (line 55) | protected void write(int index, String key, Object value) {
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary11.java
class Dictionary11 (line 3) | public class Dictionary11 extends PrimitiveDictionary implements Diction...
method Dictionary11 (line 40) | public Dictionary11(Dictionary8 base, String key, Object value) {
method Dictionary11 (line 71) | public Dictionary11(Dictionary16 base) {
method Dictionary11 (line 107) | public Dictionary11(Dictionary11 base) {
method Dictionary11 (line 143) | public Dictionary11(String[] keys, Object[] values) {
method keys (line 178) | @Override
method values (line 183) | @Override
method write (line 188) | @Override
method expand (line 258) | @Override
method contractThreshold (line 263) | @Override
method contract (line 268) | @Override
method copyOf (line 273) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary16.java
class Dictionary16 (line 5) | public class Dictionary16 extends PrimitiveDictionary implements Diction...
method Dictionary16 (line 57) | public Dictionary16(Dictionary11 base, String key, Object value) {
method Dictionary16 (line 97) | public Dictionary16(DictionaryMax base) {
method Dictionary16 (line 151) | public Dictionary16(Dictionary16 base) {
method Dictionary16 (line 205) | public Dictionary16(String[] keys, Object[] values) {
method keys (line 255) | @Override
method values (line 262) | @Override
method write (line 270) | @Override
method expand (line 375) | @Override
method contractThreshold (line 380) | @Override
method contract (line 385) | @Override
method copyOf (line 390) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary2.java
class Dictionary2 (line 3) | public class Dictionary2 extends PrimitiveDictionary implements Dictiona...
method Dictionary2 (line 13) | public Dictionary2(Dictionary1 base, String key, Object value) {
method Dictionary2 (line 23) | public Dictionary2(Dictionary3 base) {
method Dictionary2 (line 32) | public Dictionary2(Dictionary2 base) {
method Dictionary2 (line 41) | public Dictionary2(String[] keys, Object[] values) {
method keys (line 49) | @Override
method values (line 54) | @Override
method write (line 59) | @Override
method expand (line 77) | @Override
method contractThreshold (line 82) | @Override
method contract (line 87) | @Override
method copyOf (line 92) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary3.java
class Dictionary3 (line 3) | public class Dictionary3 extends PrimitiveDictionary implements Dictiona...
method Dictionary3 (line 16) | public Dictionary3(Dictionary2 base, String key, Object value) {
method Dictionary3 (line 29) | public Dictionary3(Dictionary4 base) {
method Dictionary3 (line 41) | public Dictionary3(Dictionary3 base) {
method Dictionary3 (line 53) | public Dictionary3(String[] keys, Object[] values) {
method keys (line 64) | @Override
method values (line 69) | @Override
method write (line 74) | @Override
method expand (line 97) | @Override
method contractThreshold (line 102) | @Override
method contract (line 107) | @Override
method copyOf (line 112) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary4.java
class Dictionary4 (line 3) | public class Dictionary4 extends PrimitiveDictionary implements Dictiona...
method Dictionary4 (line 19) | public Dictionary4(Dictionary3 base, String key, Object value) {
method Dictionary4 (line 35) | public Dictionary4(Dictionary6 base) {
method Dictionary4 (line 50) | public Dictionary4(Dictionary4 base) {
method Dictionary4 (line 65) | public Dictionary4(String[] keys, Object[] values) {
method keys (line 79) | @Override
method values (line 84) | @Override
method write (line 89) | @Override
method expand (line 117) | @Override
method contractThreshold (line 122) | @Override
method contract (line 127) | @Override
method copyOf (line 132) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary6.java
class Dictionary6 (line 3) | public class Dictionary6 extends PrimitiveDictionary implements Dictiona...
method Dictionary6 (line 25) | public Dictionary6(Dictionary4 base, String key, Object value) {
method Dictionary6 (line 44) | public Dictionary6(Dictionary8 base) {
method Dictionary6 (line 65) | public Dictionary6(Dictionary6 base) {
method Dictionary6 (line 86) | public Dictionary6(String[] keys, Object[] values) {
method keys (line 106) | @Override
method values (line 111) | @Override
method write (line 116) | @Override
method expand (line 154) | @Override
method contractThreshold (line 159) | @Override
method contract (line 164) | @Override
method copyOf (line 169) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary8.java
class Dictionary8 (line 3) | public class Dictionary8 extends PrimitiveDictionary implements Dictiona...
method Dictionary8 (line 31) | public Dictionary8(Dictionary6 base, String key, Object value) {
method Dictionary8 (line 56) | public Dictionary8(Dictionary11 base) {
method Dictionary8 (line 83) | public Dictionary8(Dictionary8 base) {
method Dictionary8 (line 110) | public Dictionary8(String[] keys, Object[] values) {
method keys (line 136) | @Override
method values (line 141) | @Override
method write (line 146) | @Override
method expand (line 201) | @Override
method contractThreshold (line 206) | @Override
method contract (line 211) | @Override
method copyOf (line 216) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/DictionaryFactory.java
class DictionaryFactory (line 5) | public class DictionaryFactory {
method fromMap (line 6) | public static Dictionary fromMap(Map<String, Object> properties) {
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/DictionaryMax.java
class DictionaryMax (line 5) | public class DictionaryMax extends PrimitiveDictionary implements Dictio...
method DictionaryMax (line 11) | public DictionaryMax(Dictionary16 base, String key, Object value) {
method DictionaryMax (line 21) | public DictionaryMax(DictionaryMax base) {
method DictionaryMax (line 28) | public DictionaryMax(String[] keys, Object[] values) {
method keys (line 35) | @Override
method values (line 40) | @Override
method write (line 45) | @Override
method expand (line 51) | @Override
method contractThreshold (line 65) | @Override
method contract (line 70) | @Override
method copyOf (line 85) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/dict/PrimitiveDictionary.java
class PrimitiveDictionary (line 6) | public abstract class PrimitiveDictionary implements Dictionary {
method PrimitiveDictionary (line 7) | public PrimitiveDictionary() {
method keys (line 11) | abstract String[] keys();
method values (line 13) | abstract Object[] values();
method write (line 15) | abstract void write(int index, String key, Object value);
method expand (line 17) | abstract Dictionary expand(String key, Object value);
method contractThreshold (line 19) | abstract int contractThreshold();
method contract (line 21) | abstract Dictionary contract();
method copyOf (line 23) | public abstract Dictionary copyOf();
method size (line 25) | public int size() {
method getPropertyKeys (line 38) | public String[] getPropertyKeys() {
method getProperty (line 51) | @Override
method setProperty (line 70) | @Override
method canonicalizeKeys (line 106) | @Override
method removeProperty (line 130) | @Override
method lookupKey (line 168) | protected String lookupKey(String[] keys, int i) {
method lookupValue (line 172) | protected Object lookupValue(Object[] values, int i) {
method toString (line 176) | public String toString() {
FILE: src/main/java/com/lambdazen/bitsy/ads/set/ArraySet.java
class ArraySet (line 11) | public class ArraySet<T> implements Set<T> {
method ArraySet (line 15) | public ArraySet(Object[] elements) {
method ArraySet (line 19) | protected ArraySet(Object[] elements, int size) {
method size (line 28) | @Override
method getElements (line 33) | @Override
method removeElement (line 38) | @Override
method addElement (line 65) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/ClassifierGetter.java
type ClassifierGetter (line 3) | public interface ClassifierGetter<C, T> {
method getClassifier (line 4) | public C getClassifier(T obj);
FILE: src/main/java/com/lambdazen/bitsy/ads/set/CompactMultiSetMax.java
class CompactMultiSetMax (line 16) | public class CompactMultiSetMax<C, T> {
method CompactMultiSetMax (line 23) | public CompactMultiSetMax(int initSize, boolean safe) {
method getOccupiedCells (line 29) | public int getOccupiedCells() {
method add (line 33) | public CompactMultiSetMax<C, T> add(T obj, ClassifierGetter<C, T> c) {
method addElementNoRehash (line 46) | protected void addElementNoRehash(int hashCode, T obj) {
method rehash (line 60) | private CompactMultiSetMax<C, T> rehash(int newLength, ClassifierGette...
method remove (line 73) | public CompactMultiSetMax<C, T> remove(T obj, ClassifierGetter<C, T> c) {
method removeElementNoHash (line 86) | protected void removeElementNoHash(int hashCode, T obj) {
method getSuperSetWithClassifier (line 106) | public Object[] getSuperSetWithClassifier(C key) {
method getAllElements (line 116) | public Object[] getAllElements() {
method sizeBiggerThan24 (line 138) | public boolean sizeBiggerThan24() {
FILE: src/main/java/com/lambdazen/bitsy/ads/set/CompactSet.java
class CompactSet (line 3) | public class CompactSet {
method size (line 4) | public static int size(Object set) {
method getElements (line 14) | public static Object[] getElements(Object set) {
method add (line 24) | public static <T> Object add(Object set, T elem) {
method addSafe (line 38) | public static <T> Object addSafe(Object set, T elem) {
method remove (line 47) | public static <T> Object remove(Object set, T elem) {
FILE: src/main/java/com/lambdazen/bitsy/ads/set/PrimitiveSet.java
class PrimitiveSet (line 5) | public abstract class PrimitiveSet<T> implements Set<T> {
method PrimitiveSet (line 6) | public PrimitiveSet() {
method elements (line 10) | abstract Object[] elements();
method write (line 12) | abstract void write(int index, T elem);
method expand (line 14) | abstract Set<T> expand(T elem);
method contractThreshold (line 16) | abstract int contractThreshold();
method contract (line 18) | abstract Object contract();
method size (line 20) | public int size() {
method size (line 26) | private int size(Object[] elems) {
method getElements (line 37) | public Object[] getElements() {
method addElement (line 50) | public Set<T> addElement(T elem) {
method removeElement (line 83) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/Set.java
type Set (line 4) | public interface Set<T> {
method size (line 5) | public int size();
method getElements (line 7) | public Object[] getElements();
method removeElement (line 9) | public Object removeElement(T elem);
method addElement (line 11) | public Set<T> addElement(T elem);
FILE: src/main/java/com/lambdazen/bitsy/ads/set/Set12.java
class Set12 (line 3) | public class Set12<T> extends PrimitiveSet<T> implements Set<T> {
method Set12 (line 6) | public Set12(Set8<T> oldSet, T elem) {
method Set12 (line 18) | public Set12(Set24<T> oldSet) {
method elements (line 33) | @Override
method write (line 38) | protected void write(int index, T elem) {
method expand (line 105) | @Override
method contractThreshold (line 110) | @Override
method contract (line 115) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/Set2.java
class Set2 (line 3) | public class Set2<T> extends PrimitiveSet<T> implements Set<T> {
method Set2 (line 6) | public Set2(T elem0, T elem1) {
method Set2 (line 11) | public Set2(Set3<T> oldBag) {
method elements (line 16) | @Override
method write (line 21) | protected void write(int index, T elem) {
method expand (line 36) | @Override
method contractThreshold (line 41) | @Override
method contract (line 46) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/Set24.java
class Set24 (line 3) | public class Set24<T> extends PrimitiveSet<T> implements Set<T> {
method Set24 (line 29) | public Set24(Set12<T> oldSet, T elem) {
method Set24 (line 45) | public Set24(Object[] elements) {
method lookup (line 72) | private T lookup(Object[] arr, int index) {
method elements (line 76) | @Override
method write (line 84) | protected void write(int index, T elem) {
method expand (line 218) | @Override
method contractThreshold (line 223) | @Override
method contract (line 228) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/Set3.java
class Set3 (line 3) | public class Set3<T> extends PrimitiveSet<T> implements Set<T> {
method Set3 (line 6) | public Set3(Set2<T> oldSet, T elem) {
method Set3 (line 12) | public Set3(Set4<T> oldSet) {
method elements (line 18) | @Override
method write (line 23) | protected void write(int index, T elem) {
method expand (line 42) | @Override
method contractThreshold (line 47) | @Override
method contract (line 52) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/Set4.java
class Set4 (line 3) | public class Set4<T> extends PrimitiveSet<T> implements Set<T> {
method Set4 (line 6) | public Set4(Set3<T> oldSet, T elem) {
method Set4 (line 13) | public Set4(Set6<T> oldSet) {
method elements (line 20) | @Override
method write (line 25) | protected void write(int index, T elem) {
method expand (line 48) | @Override
method contractThreshold (line 53) | @Override
method contract (line 58) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/Set6.java
class Set6 (line 3) | public class Set6<T> extends PrimitiveSet<T> implements Set<T> {
method Set6 (line 6) | public Set6(Set4<T> oldSet, T elem) {
method Set6 (line 14) | public Set6(Set8<T> oldSet) {
method elements (line 23) | @Override
method write (line 28) | protected void write(int index, T elem) {
method expand (line 59) | @Override
method contractThreshold (line 64) | @Override
method contract (line 69) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/Set8.java
class Set8 (line 3) | public class Set8<T> extends PrimitiveSet<T> implements Set<T> {
method Set8 (line 6) | public Set8(Set6<T> oldSet, T elem) {
method Set8 (line 16) | public Set8(Set12<T> oldSet) {
method elements (line 27) | @Override
method write (line 32) | protected void write(int index, T elem) {
method expand (line 78) | @Override
method contractThreshold (line 83) | @Override
method contract (line 88) | @Override
FILE: src/main/java/com/lambdazen/bitsy/ads/set/SetMax.java
class SetMax (line 3) | public class SetMax<T> implements Set<T> {
method getClassifier (line 7) | @Override
method SetMax (line 16) | public SetMax(Set24<T> oldSet, Object elem) {
method size (line 35) | @Override
method getElements (line 42) | @Override
method removeElement (line 47) | @Override
method addElement (line 66) | @Override
FILE: src/main/java/com/lambdazen/bitsy/gremlin/BitsyGraphStep.java
class BitsyGraphStep (line 26) | public final class BitsyGraphStep<S, E extends Element> extends GraphSte...
method BitsyGraphStep (line 30) | public BitsyGraphStep(final GraphStep<S, E> originalGraphStep) {
method getBitsyGraph (line 41) | private BitsyGraph getBitsyGraph() {
method vertices (line 51) | private Iterator<? extends Vertex> vertices() {
method lookupVertices (line 55) | private Iterator<Vertex> lookupVertices(
method edges (line 77) | private Iterator<? extends Edge> edges() {
method lookupEdges (line 83) | private Iterator<Edge> lookupEdges(
method toString (line 105) | @Override
method getHasContainers (line 119) | @Override
method addHasContainer (line 124) | @Override
method hashCode (line 133) | @Override
FILE: src/main/java/com/lambdazen/bitsy/gremlin/BitsyTraversalStrategy.java
class BitsyTraversalStrategy (line 15) | public class BitsyTraversalStrategy extends AbstractTraversalStrategy<Tr...
method BitsyTraversalStrategy (line 20) | private BitsyTraversalStrategy() {}
method apply (line 22) | @Override
method instance (line 42) | public static BitsyTraversalStrategy instance() {
FILE: src/main/java/com/lambdazen/bitsy/index/BitsyIndex.java
class BitsyIndex (line 11) | public abstract class BitsyIndex<T> {
method BitsyIndex (line 14) | public BitsyIndex() {
method getValue (line 18) | public abstract Object getValue(T bean);
method copy (line 20) | public abstract T copy(T bean);
method load (line 22) | public void load(Iterator<T> initialContents) {
method get (line 29) | public List<T> get(Object value) {
method add (line 49) | public void add(T bean) {
method remove (line 65) | public void remove(T bean) {
FILE: src/main/java/com/lambdazen/bitsy/index/BitsyIndexMap.java
class BitsyIndexMap (line 11) | public class BitsyIndexMap<BeanType, IndexType extends BitsyIndex<BeanTy...
method BitsyIndexMap (line 15) | public BitsyIndexMap() {
method get (line 21) | public Collection<BeanType> get(String key, Object value) {
method add (line 36) | public void add(BeanType bean) {
method remove (line 42) | public void remove(BeanType bean) {
method addKeyIndex (line 53) | protected void addKeyIndex(String key, IndexType index) {
method dropKeyIndex (line 61) | public void dropKeyIndex(String key) {
method getIndexedKeys (line 65) | public Set<String> getIndexedKeys() {
FILE: src/main/java/com/lambdazen/bitsy/index/EdgeIndex.java
class EdgeIndex (line 7) | public class EdgeIndex extends BitsyIndex<EdgeBean> {
method EdgeIndex (line 10) | public EdgeIndex(String key, Iterator<EdgeBean> initialContents) {
method getValue (line 18) | @Override
method copy (line 24) | @Override
FILE: src/main/java/com/lambdazen/bitsy/index/EdgeIndexMap.java
class EdgeIndexMap (line 6) | public class EdgeIndexMap extends BitsyIndexMap<EdgeBean, EdgeIndex> {
method EdgeIndexMap (line 7) | public EdgeIndexMap() {
method createKeyIndex (line 11) | public void createKeyIndex(String key, Iterator<EdgeBean> iter) {
FILE: src/main/java/com/lambdazen/bitsy/index/IndexHelper.java
class IndexHelper (line 10) | public class IndexHelper {
method filterElementsByKeyValue (line 11) | public static <T extends BitsyElement> Collection<T> filterElementsByK...
method filterVertexBeansByKeyValue (line 30) | public static Collection<VertexBean> filterVertexBeansByKeyValue(
method filterEdgeBeansByKeyValue (line 47) | public static Collection<EdgeBean> filterEdgeBeansByKeyValue(Collectio...
FILE: src/main/java/com/lambdazen/bitsy/index/VertexIndex.java
class VertexIndex (line 7) | public class VertexIndex extends BitsyIndex<VertexBean> {
method VertexIndex (line 10) | public VertexIndex(String key, Iterator<VertexBean> initialContents) {
method getValue (line 18) | @Override
method copy (line 24) | @Override
FILE: src/main/java/com/lambdazen/bitsy/index/VertexIndexMap.java
class VertexIndexMap (line 6) | public class VertexIndexMap extends BitsyIndexMap<VertexBean, VertexInde...
method VertexIndexMap (line 7) | public VertexIndexMap() {
method createKeyIndex (line 11) | public void createKeyIndex(String key, Iterator<VertexBean> iter) {
FILE: src/main/java/com/lambdazen/bitsy/jsr223/BitsyGremlinPlugin.java
class BitsyGremlinPlugin (line 17) | public class BitsyGremlinPlugin extends AbstractGremlinPlugin {
method imports (line 20) | private static ImportCustomizer imports() {
method BitsyGremlinPlugin (line 38) | public BitsyGremlinPlugin() {
method instance (line 42) | public static BitsyGremlinPlugin instance() {
FILE: src/main/java/com/lambdazen/bitsy/store/AdjacencyMap.java
class AdjacencyMap (line 16) | public class AdjacencyMap {
method AdjacencyMap (line 21) | public AdjacencyMap(boolean isConcurrent, IEdgeRemover edgeRemover) {
method clear (line 27) | public void clear() {
method addEdge (line 32) | public void addEdge(UUID edgeId, UUID outVId, String label, UUID inVId...
method addToTreeMap (line 38) | private void addToTreeMap(Map<UUID, TreeMap<Endpoint, Integer>> adjMap...
method removeEdge (line 48) | public void removeEdge(UUID edgeId, UUID outVId, String label, UUID in...
method removeVertex (line 59) | public void removeVertex(UUID vertexId) {
method getEdges (line 70) | public List<UUID> getEdges(UUID vertexId, Direction dir, String[] edge...
method removeMatchingKeys (line 100) | private boolean removeMatchingKeys(
method findMatchingValues (line 174) | private void findMatchingValues(NavigableMap<Endpoint, Integer> map, E...
FILE: src/main/java/com/lambdazen/bitsy/store/AdjacencyMapForBeans.java
class AdjacencyMapForBeans (line 14) | public class AdjacencyMapForBeans {
method AdjacencyMapForBeans (line 18) | public AdjacencyMapForBeans(boolean isConcurrent, IEdgeRemover edgeRem...
method addEdge (line 28) | public void addEdge(EdgeBean eBean) {
method addEdgeToAdjList (line 37) | private Object addEdgeToAdjList(Object adjList, EdgeBean eBean) {
method removeEdgeWithoutCallback (line 54) | protected void removeEdgeWithoutCallback(EdgeBean eBean) {
method removeEdgeFromAdjList (line 69) | private Object removeEdgeFromAdjList(Object adjList, EdgeBean eBean) {
method getEdgesFromAdjList (line 86) | private Object[] getEdgesFromAdjList(Object adjList) {
method convertToSet (line 96) | private Object convertToSet(CompactMultiSetMax<String, EdgeBean> set) {
method convertToMultiSet (line 102) | private Object convertToMultiSet(SetMax<EdgeBean> set) {
method removeVertex (line 115) | public void removeVertex(VertexBean vBean) {
method getEdges (line 145) | public List<EdgeBean> getEdges(VertexBean vBean, Direction dir, String...
FILE: src/main/java/com/lambdazen/bitsy/store/BackupJob.java
class BackupJob (line 6) | public class BackupJob extends JobWithCountDownLatch implements IVeReorg...
method BackupJob (line 10) | public BackupJob(Path backupDir) {
method getBackupDir (line 14) | public Path getBackupDir() {
method getException (line 18) | public BitsyException getException() {
method setException (line 22) | public void setException(BitsyException bex) {
FILE: src/main/java/com/lambdazen/bitsy/store/CompactAndCopyTask.java
class CompactAndCopyTask (line 16) | public class CompactAndCopyTask implements Runnable {
method CompactAndCopyTask (line 29) | public CompactAndCopyTask(
method run (line 43) | public void run() {
method getOutputLines (line 226) | public int getOutputLines() {
FILE: src/main/java/com/lambdazen/bitsy/store/EdgeBean.java
class EdgeBean (line 12) | @JsonPropertyOrder({"class", "id", "v", "s", "o", "l", "i", "p"})
method EdgeBean (line 22) | public EdgeBean(
method EdgeBean (line 34) | public EdgeBean(EdgeBean orig) {
method getId (line 50) | @JsonIgnore
method getIdStr (line 56) | @JsonProperty("id")
method getProperties (line 61) | @JsonProperty("p")
method getPropertiesDict (line 76) | @JsonIgnore
method getVersion (line 81) | @JsonProperty("v")
method getInVertexId (line 86) | @JsonIgnore
method getOutVertexId (line 91) | @JsonIgnore
method getLabel (line 96) | @JsonProperty("l")
FILE: src/main/java/com/lambdazen/bitsy/store/EdgeBeanJson.java
class EdgeBeanJson (line 12) | public class EdgeBeanJson extends EdgeBean {
method EdgeBeanJson (line 18) | @JsonCreator
method EdgeBeanJson (line 37) | public EdgeBeanJson(
method getInVertexId (line 52) | @JsonIgnore
method getOutVertexId (line 58) | @JsonIgnore
method getInVertexIdStr (line 64) | @JsonProperty("i")
method getOutVertexIdStr (line 69) | @JsonProperty("o")
method getState (line 74) | @JsonProperty("s")
FILE: src/main/java/com/lambdazen/bitsy/store/Endpoint.java
class Endpoint (line 7) | public class Endpoint implements Serializable, Comparable<Endpoint> {
method Endpoint (line 15) | public Endpoint(String edgeLabel, UUID edgeId) {
method toString (line 21) | public String toString() {
method setMarker (line 25) | public void setMarker() {
method isMarker (line 29) | public boolean isMarker() {
method getEdgeLabel (line 33) | public String getEdgeLabel() {
method getEdgeId (line 37) | public UUID getEdgeId() {
method compareTo (line 41) | public int compareTo(Endpoint other) {
method equals (line 101) | public boolean equals(Object o) {
method isMatch (line 114) | public boolean isMatch(Endpoint other) {
FILE: src/main/java/com/lambdazen/bitsy/store/FileBackedMemoryGraphStore.java
class FileBackedMemoryGraphStore (line 53) | public class FileBackedMemoryGraphStore implements IGraphStore {
method FileBackedMemoryGraphStore (line 108) | public FileBackedMemoryGraphStore(MemoryGraphStore memStore, Path dbPa...
method FileBackedMemoryGraphStore (line 112) | public FileBackedMemoryGraphStore(
method getTxLogFlushPotential (line 302) | public TxLogFlushPotential getTxLogFlushPotential() {
method getVEReorgPotential (line 306) | public VEObsolescencePotential getVEReorgPotential() {
method loadVersionAndIndexes (line 310) | private void loadVersionAndIndexes() {
method saveVersionAndIndexes (line 347) | private void saveVersionAndIndexes() {
method getOrderedTxLogs (line 389) | private CommittableFileLog[] getOrderedTxLogs(CommittableFileLog txLog...
method getEarlierBuffer (line 401) | private CommittableFileLog getEarlierBuffer(CommittableFileLog log1, C...
method toString (line 413) | public String toString() {
method shutdown (line 417) | public void shutdown() {
method openFileLog (line 435) | private CommittableFileLog openFileLog(String fileName, boolean isTxLo...
method prepareForAppend (line 469) | private void prepareForAppend(CommittableFileLog cfl) {
method getVertex (line 479) | @Override
method getEdge (line 484) | @Override
method getBitsyVertex (line 489) | @Override
method getBitsyEdge (line 494) | @Override
method getEdges (line 499) | @Override
method commit (line 504) | @Override
method flushTxLog (line 588) | public void flushTxLog() {
method backup (line 621) | public void backup(Path backupDir) {
class FlushNowJob (line 665) | public class FlushNowJob implements ITxBatchJob {}
class TxUnitFlusher (line 668) | public class TxUnitFlusher implements BufferFlusher<TxUnit> {
method flushBuffer (line 669) | @Override
class TxBatchQueuer (line 678) | public class TxBatchQueuer implements BufferQueuer<ITxBatchJob> {
method onQueue (line 679) | @Override
class TxBatchFlusher (line 725) | public class TxBatchFlusher implements BufferFlusher<ITxBatchJob> {
method flushBuffer (line 726) | @Override
class TxLogQueuer (line 742) | public class TxLogQueuer implements BufferQueuer<IVeReorgJob> {
method onQueue (line 743) | @Override
class TxLogFlusher (line 835) | public class TxLogFlusher implements BufferFlusher<IVeReorgJob> {
method flushBuffer (line 836) | @Override
method getAllVertices (line 882) | @Override
method getAllEdges (line 887) | @Override
method createKeyIndex (line 892) | @Override
method dropKeyIndex (line 902) | @Override
method getIndexedKeys (line 912) | @Override
method lookupVertices (line 917) | @Override
method lookupEdges (line 922) | @Override
method allowFullGraphScans (line 927) | @Override
FILE: src/main/java/com/lambdazen/bitsy/store/IEdgeRemover.java
type IEdgeRemover (line 6) | public interface IEdgeRemover {
method removeEdge (line 7) | public IEdge removeEdge(UUID id);
FILE: src/main/java/com/lambdazen/bitsy/store/IStringCanonicalizer.java
type IStringCanonicalizer (line 3) | public interface IStringCanonicalizer {
method canonicalize (line 4) | public String canonicalize(String str);
FILE: src/main/java/com/lambdazen/bitsy/store/ITxBatchJob.java
type ITxBatchJob (line 3) | public interface ITxBatchJob {}
FILE: src/main/java/com/lambdazen/bitsy/store/IVeReorgJob.java
type IVeReorgJob (line 3) | public interface IVeReorgJob {}
FILE: src/main/java/com/lambdazen/bitsy/store/IndexBean.java
class IndexBean (line 12) | @JsonPropertyOrder({"type", "key"})
method IndexBean (line 17) | @JsonCreator
method getType (line 23) | @JsonProperty("type")
method getKey (line 28) | @JsonProperty("key")
method getIndexClass (line 33) | @JsonIgnore
FILE: src/main/java/com/lambdazen/bitsy/store/JobWithCountDownLatch.java
class JobWithCountDownLatch (line 5) | public class JobWithCountDownLatch {
method JobWithCountDownLatch (line 8) | public JobWithCountDownLatch() {
method getCountDownLatch (line 12) | public CountDownLatch getCountDownLatch() {
FILE: src/main/java/com/lambdazen/bitsy/store/LoadTask.java
class LoadTask (line 19) | public class LoadTask implements Runnable {
method LoadTask (line 33) | public LoadTask(
method getTotalVE (line 49) | public long getTotalVE() {
method run (line 53) | public void run() {
FILE: src/main/java/com/lambdazen/bitsy/store/MemoryGraphStore.java
class MemoryGraphStore (line 33) | public class MemoryGraphStore implements IGraphStore {
method MemoryGraphStore (line 54) | public MemoryGraphStore(boolean allowFullGraphScans) {
method reset (line 62) | protected void reset() {
method allowFullGraphScans (line 76) | @Override
method commit (line 85) | public void commit(ICommitChanges changes) {
method commit (line 91) | public void commit(ICommitChanges changes, boolean incrementVersions, ...
method beginWrite (line 107) | private void beginWrite() {
method endWrite (line 123) | private void endWrite() {
method beginRead (line 139) | private void beginRead(RetryDetails retryDetails, boolean degradeToRea...
method endRead (line 166) | private void endRead(RetryDetails retryDetails) {
method shouldRetryRead (line 172) | private boolean shouldRetryRead(RetryDetails retryDetails) {
method checkForConcurrentModifications (line 189) | private void checkForConcurrentModifications(ICommitChanges changes, b...
method saveChanges (line 241) | protected long saveChanges(ICommitChanges changes) {
method saveChanges (line 247) | protected long saveChanges(ICommitChanges changes, IStringCanonicalize...
method saveEdge (line 263) | protected long saveEdge(long addedVE, BitsyEdge edge, IStringCanonical...
method saveVertex (line 309) | protected long saveVertex(long addedVE, BitsyVertex vertex, IStringCan...
method getVertex (line 343) | public VertexBean getVertex(UUID id) {
method getEdge (line 349) | public EdgeBean getEdge(UUID id) {
method getBitsyVertex (line 355) | @Override
method getBitsyEdge (line 376) | @Override
method getEdges (line 398) | public List<EdgeBean> getEdges(UUID vertexId, Direction dir, String[] ...
method getAllVertices (line 416) | @Override
method getAllEdges (line 426) | @Override
method createKeyIndex (line 431) | @Override
method dropKeyIndex (line 451) | @Override
method getIndexedKeys (line 471) | @Override
method lookupVertices (line 492) | @Override
method lookupEdges (line 509) | @Override
method shutdown (line 526) | @Override
method asBean (line 532) | public EdgeBean asBean(BitsyEdge edge) {
method asBean (line 552) | public EdgeBean asBean(BitsyEdge edge, IStringCanonicalizer canonicali...
class RetryDetails (line 568) | public class RetryDetails {
method RetryDetails (line 573) | public RetryDetails() {
FILE: src/main/java/com/lambdazen/bitsy/store/ParallelRecordReader.java
class ParallelRecordReader (line 18) | public class ParallelRecordReader extends RecordReader {
method ParallelRecordReader (line 36) | public ParallelRecordReader(
method next (line 59) | public Record next() throws Exception {
method shutdownServices (line 95) | private void shutdownServices() {
class Batch (line 107) | public class Batch {
method Batch (line 114) | public Batch() {
method isLastBatch (line 138) | public boolean isLastBatch() {
method deserialize (line 142) | public void deserialize() throws JsonProcessingException, IOException {
method getRecords (line 159) | public List<Record> getRecords() throws InterruptedException {
method setException (line 166) | public void setException(Exception e) {
method getException (line 170) | public Exception getException() {
class ProducerTask (line 175) | public class ProducerTask implements Runnable {
method run (line 176) | public void run() {
FILE: src/main/java/com/lambdazen/bitsy/store/Record.java
class Record (line 21) | public class Record {
type RecordType (line 27) | public static enum RecordType {
method hashCode (line 51) | public static int hashCode(String str) {
method Record (line 60) | public Record(RecordType type, String json) {
method deserialize (line 65) | public void deserialize(ObjectReader vReader, ObjectReader eReader) th...
method getType (line 77) | public RecordType getType() {
method getJson (line 81) | public String getJson() {
method generateVertexLine (line 86) | public static void generateVertexLine(StringWriter sw, ObjectMapper ma...
method generateEdgeLine (line 103) | public static void generateEdgeLine(StringWriter sw, ObjectMapper mapp...
method generateDBLine (line 119) | public static String generateDBLine(RecordType type, String line) {
method parseRecord (line 126) | public static Record parseRecord(String dbLine, int lineNo, String fil...
method typeFromChar (line 153) | private static RecordType typeFromChar(char recChar) {
method toHex (line 164) | private static String toHex(int input) {
method checkObsolete (line 174) | public boolean checkObsolete(IGraphStore store, boolean isReorg, int l...
method getVertex (line 266) | public BitsyVertex getVertex() {
method getEdge (line 270) | public BitsyEdge getEdge() {
FILE: src/main/java/com/lambdazen/bitsy/store/RecordReader.java
class RecordReader (line 6) | public class RecordReader {
method RecordReader (line 14) | public RecordReader(CommittableFileLog cfl, ObjectReader vReader, Obje...
method next (line 21) | public Record next() throws Exception {
FILE: src/main/java/com/lambdazen/bitsy/store/SingleThreadedStringCanonicalizer.java
class SingleThreadedStringCanonicalizer (line 7) | public class SingleThreadedStringCanonicalizer implements IStringCanonic...
method SingleThreadedStringCanonicalizer (line 10) | public SingleThreadedStringCanonicalizer() {
method canonicalize (line 14) | public String canonicalize(String str) {
FILE: src/main/java/com/lambdazen/bitsy/store/TxBatch.java
class TxBatch (line 9) | public class TxBatch implements ITxBatchJob {
method TxBatch (line 13) | public TxBatch(List<TxUnit> trans) {
method getTxUnitList (line 18) | public List<TxUnit> getTxUnitList() {
method getSize (line 22) | public int getSize() {
method setSize (line 26) | public void setSize(int size) {
FILE: src/main/java/com/lambdazen/bitsy/store/TxLog.java
class TxLog (line 8) | public class TxLog implements IVeReorgJob {
method TxLog (line 12) | public TxLog(CommittableFileLog cfl) {
method getCommittableFileLog (line 17) | public CommittableFileLog getCommittableFileLog() {
method setReorgPotDiff (line 21) | public void setReorgPotDiff(int rpd) {
method getReorgPotDiff (line 25) | public int getReorgPotDiff() {
FILE: src/main/java/com/lambdazen/bitsy/store/TxLogFlushPotential.java
class TxLogFlushPotential (line 13) | public class TxLogFlushPotential implements BufferPotential<ITxBatchJob> {
method TxLogFlushPotential (line 19) | public TxLogFlushPotential(long txLogThreshold) {
method getTxLogThreshold (line 24) | public long getTxLogThreshold() {
method setTxLogThreshold (line 28) | public void setTxLogThreshold(long txLogThreshold) {
method addWork (line 32) | @Override
method reset (line 50) | @Override
FILE: src/main/java/com/lambdazen/bitsy/store/TxUnit.java
class TxUnit (line 8) | public class TxUnit extends JobWithCountDownLatch {
method TxUnit (line 14) | public TxUnit(ByteBuffer vertices, ByteBuffer edges, ByteBuffer tx) {
method getByteBufferForV (line 20) | public ByteBuffer getByteBufferForV() {
method getByteBufferForE (line 26) | public ByteBuffer getByteBufferForE() {
method getByteBufferForT (line 32) | public ByteBuffer getByteBufferForT() {
method writeToFile (line 38) | public int writeToFile(CommittableFileLog cfl) {
method getException (line 52) | public BitsyException getException() {
method setException (line 56) | public void setException(BitsyException bex) {
FILE: src/main/java/com/lambdazen/bitsy/store/VEObsolescencePotential.java
class VEObsolescencePotential (line 7) | public class VEObsolescencePotential implements BufferPotential<IVeReorg...
method VEObsolescencePotential (line 15) | public VEObsolescencePotential(int minLinesPerReorg, double factor, lo...
method addWork (line 22) | @Override
method reset (line 42) | @Override
method setOrigLines (line 48) | public void setOrigLines(int origLines) {
method getFactor (line 52) | public double getFactor() {
method setFactor (line 56) | public void setFactor(double factor) {
method getMinLinesPerReorg (line 60) | public int getMinLinesPerReorg() {
method setMinLinesPerReorg (line 64) | public void setMinLinesPerReorg(int minLinesPerReorg) {
FILE: src/main/java/com/lambdazen/bitsy/store/VertexBean.java
class VertexBean (line 10) | public class VertexBean extends UUID implements Serializable {
method VertexBean (line 20) | public VertexBean(UUID uuid, String label, Dictionary properties, int ...
method VertexBean (line 29) | public VertexBean(VertexBean orig) {
method getId (line 39) | @JsonIgnore
method getIdStr (line 45) | @JsonProperty("id")
method getProperties (line 50) | @JsonProperty("p")
method getPropertiesDict (line 65) | @JsonIgnore
method getVersion (line 70) | @JsonProperty("v")
method getLabel (line 75) | @JsonProperty("l")
method copyFrom (line 80) | public void copyFrom(VertexBean vBean) {
FILE: src/main/java/com/lambdazen/bitsy/store/VertexBeanJson.java
class VertexBeanJson (line 13) | @JsonPropertyOrder({"id", "v", "s", "p"})
method VertexBeanJson (line 19) | @JsonCreator
method VertexBeanJson (line 31) | public VertexBeanJson(UUID id, String label, Dictionary properties, in...
method getState (line 37) | @JsonProperty("s")
method getIdStr (line 42) | @JsonProperty("id")
method getProperties (line 47) | @JsonProperty("p")
FILE: src/main/java/com/lambdazen/bitsy/tx/BitsyTransaction.java
class BitsyTransaction (line 32) | public class BitsyTransaction implements ITransaction, ICommitChanges {
method BitsyTransaction (line 41) | public BitsyTransaction(BitsyTransactionContext context, BitsyIsolatio...
method createThreadedTx (line 47) | @Override
method graph (line 56) | public BitsyGraph graph() {
method open (line 60) | @Override
method commit (line 75) | @Override
method rollback (line 80) | @Override
method close (line 85) | @Override
method isOpen (line 91) | public boolean isOpen() {
method isStopped (line 95) | public boolean isStopped() {
method getIsolationLevel (line 99) | @Override
method setIsolationLevel (line 104) | @Override
method save (line 109) | public void save(boolean commit) {
method checkIfActive (line 132) | public void checkIfActive() throws BitsyException {
method validateForQuery (line 136) | public void validateForQuery(BitsyElement bitsyElement) throws BitsyEx...
method isDeleted (line 145) | private boolean isDeleted(BitsyElement bitsyElement) {
method getVertex (line 158) | public Vertex getVertex(UUID id) throws BitsyException {
method getEdge (line 189) | public Edge getEdge(UUID id) throws BitsyException {
method isDeletedVertex (line 228) | private boolean isDeletedVertex(UUID id) {
method getEdges (line 234) | public Iterable<Edge> getEdges(BitsyVertex bitsyVertex, Direction dir,...
method markForPropertyUpdate (line 305) | public void markForPropertyUpdate(BitsyElement bitsyElement) throws Bi...
method addVertex (line 325) | public void addVertex(BitsyVertex vertex) throws BitsyException {
method removeVertex (line 334) | public void removeVertex(BitsyVertex vertex) throws BitsyException {
method addEdge (line 357) | public void addEdge(BitsyEdge edge) throws BitsyException {
method removeEdge (line 377) | public void removeEdge(BitsyEdge edge) throws BitsyException {
method getVertexChanges (line 400) | public Collection<BitsyVertex> getVertexChanges() {
method getEdgeChanges (line 404) | public Collection<BitsyEdge> getEdgeChanges() {
method getAllVertices (line 408) | @Override
method getAllEdges (line 422) | @Override
method lookupVertices (line 436) | @Override
method lookupEdges (line 470) | @Override
method readWrite (line 505) | @Override
method onReadWrite (line 510) | @Override
method onClose (line 516) | @Override
method addTransactionListener (line 522) | @Override
method removeTransactionListener (line 527) | @Override
method clearTransactionListeners (line 532) | @Override
method begin (line 538) | public <T extends TraversalSource> T begin(final Class<T> traversalSou...
FILE: src/main/java/com/lambdazen/bitsy/tx/BitsyTransactionContext.java
class BitsyTransactionContext (line 22) | public class BitsyTransactionContext {
method BitsyTransactionContext (line 36) | public BitsyTransactionContext(IGraphStore store) {
method removeEdgeOnVertexDelete (line 53) | private IEdge removeEdgeOnVertexDelete(UUID edgeId) throws BitsyExcept...
method addTransactionListener (line 63) | public void addTransactionListener(Consumer<Status> listener) {
method removeTransactionListener (line 67) | public void removeTransactionListener(Consumer<Status> listener) {
method clearTransactionListeners (line 71) | public void clearTransactionListeners() {
method announceCommit (line 75) | public void announceCommit(BitsyTransaction t) {
method announceRollback (line 79) | public void announceRollback(BitsyTransaction t) {
method onReadWrite (line 83) | public void onReadWrite(Consumer<Transaction> consumer) {
method onClose (line 88) | public void onClose(Consumer<Transaction> consumer) {
method getReadWriteConsumer (line 92) | public Consumer<Transaction> getReadWriteConsumer() {
method getCloseConsumer (line 96) | public Consumer<Transaction> getCloseConsumer() {
method clear (line 100) | public void clear() {
FILE: src/main/java/com/lambdazen/bitsy/util/BitsyElementIterator.java
class BitsyElementIterator (line 12) | public abstract class BitsyElementIterator<BeanType, ElementType extends...
method BitsyElementIterator (line 19) | public BitsyElementIterator(Collection<BeanType> vertices, Iterator<El...
method BitsyElementIterator (line 26) | public BitsyElementIterator(
method getId (line 40) | public abstract UUID getId(BeanType bean);
method getElement (line 42) | public abstract ElementType getElement(BeanType bean);
method hasNext (line 44) | public boolean hasNext() {
method next (line 86) | public ElementType next() {
method remove (line 103) | public void remove() {
FILE: src/main/java/com/lambdazen/bitsy/util/BufferFlusher.java
type BufferFlusher (line 8) | public interface BufferFlusher<T> {
method flushBuffer (line 11) | public void flushBuffer(BufferName bufName, List<T> workList) throws B...
FILE: src/main/java/com/lambdazen/bitsy/util/BufferPotential.java
type BufferPotential (line 10) | public interface BufferPotential<T> {
method addWork (line 16) | public boolean addWork(T newWork);
method reset (line 22) | public void reset();
FILE: src/main/java/com/lambdazen/bitsy/util/BufferQueuer.java
type BufferQueuer (line 7) | public interface BufferQueuer<T> {
method onQueue (line 10) | public void onQueue(BufferName bufName, T work) throws BitsyException;
FILE: src/main/java/com/lambdazen/bitsy/util/CommittableFileLog.java
class CommittableFileLog (line 19) | public class CommittableFileLog {
method CommittableFileLog (line 51) | public CommittableFileLog(Path filePath, boolean isTxLog) throws IOExc...
method getCounter (line 57) | public Long getCounter() {
method isTxLog (line 61) | public boolean isTxLog() {
method getPath (line 65) | public Path getPath() {
method resetReadBuffers (line 69) | public void resetReadBuffers() {
method readLine (line 80) | public String readLine() {
method mark (line 169) | public void mark() {
method mark (line 173) | public void mark(int numBytesBehind) {
method getMarkPosition (line 193) | public long getMarkPosition() {
method truncateAtMark (line 197) | public void truncateAtMark() {
method openForAppend (line 217) | public void openForAppend() {
method openForOverwrite (line 242) | public void openForOverwrite(Long counter) {
method exists (line 282) | public boolean exists() {
method openForRead (line 286) | public void openForRead() {
method append (line 343) | public void append(byte[] toWrite) throws BitsyException {
method append (line 349) | public void append(ByteBuffer buf) throws BitsyException {
method commit (line 362) | public void commit() throws BitsyException {
method close (line 375) | public void close() {
method toString (line 392) | public String toString() {
method size (line 396) | public long size() {
method setLockMode (line 408) | public static void setLockMode(boolean b) {
FILE: src/main/java/com/lambdazen/bitsy/util/DefaultCommitChanges.java
class DefaultCommitChanges (line 11) | public class DefaultCommitChanges implements ICommitChanges {
method DefaultCommitChanges (line 15) | public DefaultCommitChanges() {
method getVertexChanges (line 20) | @Override
method getEdgeChanges (line 25) | @Override
method reset (line 30) | public void reset() {
method changeVertex (line 36) | public void changeVertex(BitsyVertex vertex) throws BitsyException {
method changeEdge (line 40) | public void changeEdge(BitsyEdge edge) throws BitsyException {
FILE: src/main/java/com/lambdazen/bitsy/util/DoubleBuffer.java
class DoubleBuffer (line 14) | public class DoubleBuffer<T> {
type BufferName (line 17) | public enum BufferName {
method DoubleBuffer (line 39) | public DoubleBuffer(BufferPotential<T> initPot, BufferFlusher<T> flush...
method DoubleBuffer (line 43) | public DoubleBuffer(
method getPot (line 64) | public BufferPotential<T> getPot() {
method stop (line 68) | public void stop(int joinTimeout) {
method addWork (line 91) | public void addWork(final T work) throws BitsyException {
method getBufferToFlush (line 111) | public BufferName getBufferToFlush() throws InterruptedException {
method getWorkList (line 131) | public List<T> getWorkList(BufferName bufName) {
method getEnqueueBuffer (line 136) | public BufferName getEnqueueBuffer() {
method completedFlush (line 140) | public void completedFlush() {
method setException (line 152) | public void setException(BitsyException bitsyException) {
method getPotential (line 158) | public BufferPotential<T> getPotential() {
FILE: src/main/java/com/lambdazen/bitsy/util/DoubleBufferThread.java
class DoubleBufferThread (line 11) | public class DoubleBufferThread<T> extends Thread {
method DoubleBufferThread (line 19) | public DoubleBufferThread(String threadName, DoubleBuffer<T> buf, Buff...
method safeStop (line 29) | public void safeStop() {
method run (line 33) | public void run() {
method doFlush (line 53) | public void doFlush() throws InterruptedException {
FILE: src/main/java/com/lambdazen/bitsy/util/DoubleBufferWithExecWork.java
class DoubleBufferWithExecWork (line 5) | public class DoubleBufferWithExecWork<T> extends DoubleBuffer<T> {
method DoubleBufferWithExecWork (line 8) | public DoubleBufferWithExecWork(
method addAndExecuteWork (line 23) | public void addAndExecuteWork(final T work) throws BitsyException {
FILE: src/main/java/com/lambdazen/bitsy/util/EdgeIterator.java
class EdgeIterator (line 10) | public class EdgeIterator extends BitsyElementIterator<EdgeBean, BitsyEd...
method EdgeIterator (line 13) | public EdgeIterator(BitsyTransaction tx, Collection<BitsyEdge> txEdges...
method EdgeIterator (line 19) | public EdgeIterator(
method getId (line 29) | @Override
method getElement (line 34) | @Override
FILE: src/main/java/com/lambdazen/bitsy/util/VertexIterator.java
class VertexIterator (line 10) | public class VertexIterator extends BitsyElementIterator<VertexBean, Bit...
method VertexIterator (line 13) | public VertexIterator(BitsyTransaction tx, Collection<BitsyVertex> txV...
method VertexIterator (line 19) | public VertexIterator(
method getId (line 29) | @Override
method getElement (line 34) | @Override
FILE: src/main/java/com/lambdazen/bitsy/wrapper/BitsyAutoReloadingEdge.java
class BitsyAutoReloadingEdge (line 14) | public class BitsyAutoReloadingEdge implements Edge {
method BitsyAutoReloadingEdge (line 18) | public BitsyAutoReloadingEdge(BitsyGraph g, BitsyEdge e) {
method getBaseEdge (line 23) | public Edge getBaseEdge() {
method remove (line 31) | @Override
method id (line 36) | @Override
method label (line 42) | @Override
method hashCode (line 47) | public int hashCode() {
method equals (line 51) | public boolean equals(Object o) {
method toString (line 55) | public String toString() {
method graph (line 59) | @Override
method property (line 64) | @Override
method vertices (line 69) | @Override
method properties (line 74) | @Override
FILE: src/main/java/com/lambdazen/bitsy/wrapper/BitsyAutoReloadingGraph.java
class BitsyAutoReloadingGraph (line 14) | public class BitsyAutoReloadingGraph implements Graph {
method BitsyAutoReloadingGraph (line 17) | public BitsyAutoReloadingGraph(BitsyGraph g) {
method getBaseGraph (line 21) | public BitsyGraph getBaseGraph() {
method toString (line 25) | public String toString() {
method open (line 29) | public static final BitsyAutoReloadingGraph open(Configuration configu...
method addVertex (line 33) | @Override
method compute (line 40) | @Override
method compute (line 45) | @Override
method vertices (line 50) | @Override
method edges (line 56) | @Override
method tx (line 63) | @Override
method close (line 68) | @Override
method variables (line 73) | @Override
method configuration (line 78) | @Override
method features (line 83) | @Override
class VertexIterator (line 88) | public static class VertexIterator implements Iterator<Vertex> {
method VertexIterator (line 92) | public VertexIterator(BitsyGraph g, Iterator<Vertex> iter) {
method hasNext (line 97) | @Override
method next (line 102) | @Override
method remove (line 107) | @Override
class EdgeIterator (line 113) | public static class EdgeIterator implements Iterator<Edge> {
method EdgeIterator (line 117) | public EdgeIterator(BitsyGraph g, Iterator<Edge> iter) {
method hasNext (line 122) | @Override
method next (line 127) | @Override
method remove (line 132) | @Override
FILE: src/main/java/com/lambdazen/bitsy/wrapper/BitsyAutoReloadingVertex.java
class BitsyAutoReloadingVertex (line 16) | public class BitsyAutoReloadingVertex implements Vertex {
method BitsyAutoReloadingVertex (line 20) | public BitsyAutoReloadingVertex(BitsyGraph g, BitsyVertex v) {
method getBaseVertex (line 25) | public Vertex getBaseVertex() {
method id (line 33) | @Override
method label (line 39) | @Override
method hashCode (line 44) | public int hashCode() {
method equals (line 48) | public boolean equals(Object o) {
method toString (line 52) | public String toString() {
method graph (line 56) | @Override
method remove (line 61) | @Override
method addEdge (line 66) | @Override
method edges (line 71) | @Override
method vertices (line 76) | @Override
method property (line 81) | @Override
method property (line 86) | @Override
method property (line 91) | @Override
method properties (line 96) | @Override
FILE: src/test/java/com/lambdazen/bitsy/BitsyGraphIT.java
class BitsyGraphIT (line 32) | public class BitsyGraphIT extends FileBasedTestCase {
method isPersistent (line 38) | public boolean isPersistent() {
method setUp (line 42) | public void setUp() throws IOException {
method doSetUp (line 48) | public void doSetUp(boolean delete) throws IOException {
method deleteDirectory (line 58) | protected static void deleteDirectory(final File directory) {
method deleteDirectory (line 62) | protected static void deleteDirectory(final File directory, boolean de...
method tearDown (line 78) | public void tearDown() {
method getVertex (line 87) | private Vertex getVertex(Graph graph, Object id) {
method getEdge (line 96) | private Edge getEdge(Graph graph, Object id) {
method addEdge (line 105) | private Edge addEdge(Graph graph, Vertex vOut, Vertex vIn, String labe...
method removeEdge (line 109) | private void removeEdge(Graph graph, Edge edge) {
method removeVertex (line 113) | private void removeVertex(Graph graph, Vertex vertex) {
method testLoop (line 117) | public void testLoop() throws IOException {
method testClique (line 384) | public void testClique() throws IOException {
method testTypes (line 668) | public void testTypes() throws IOException {
method testEdgeCases (line 873) | public void testEdgeCases() {
method testMultiThreadedEdgeQueries (line 1052) | public void testMultiThreadedEdgeQueries() throws IOException {
method setException (line 1232) | private void setException(Throwable t) {
method getException (line 1236) | private Throwable getException() {
method testMultiThreadedTreeCreation (line 1240) | public void testMultiThreadedTreeCreation() throws IOException {
method checkIterCount (line 1445) | private void checkIterCount(Iterator iter, int expectedCount) {
method testPersistence (line 1455) | public void testPersistence() throws Exception {
method assertPair (line 1658) | private void assertPair(int a, int b, int c, int d) {
method lineCount (line 1667) | private int lineCount(Path file) throws Exception {
method testLargeFileSaveLoad (line 1684) | public void testLargeFileSaveLoad() throws Exception {
method XtestMultiThreadedCommits (line 1768) | public void XtestMultiThreadedCommits() throws Exception {
method XtestMultiThreadedReadsOnBipartiteGraph (line 1873) | public void XtestMultiThreadedReadsOnBipartiteGraph() throws Exception {
method testConcurrentAccessForVersions (line 2089) | public void testConcurrentAccessForVersions() throws InterruptedExcept...
method testLargeDegreePerformance (line 2157) | public void testLargeDegreePerformance() {
FILE: src/test/java/com/lambdazen/bitsy/BitsyMemGraphIT.java
class BitsyMemGraphIT (line 9) | public class BitsyMemGraphIT extends BitsyGraphIT {
method isPersistent (line 10) | public boolean isPersistent() {
method setUp (line 14) | public void setUp() {
method tearDown (line 19) | public void tearDown() {
method testPersistence (line 28) | public void testPersistence() {
method testObsolescence (line 32) | public void testObsolescence() {
FILE: src/test/java/com/lambdazen/bitsy/FileBasedTestCase.java
class FileBasedTestCase (line 11) | public class FileBasedTestCase extends TestCase {
method tempDir (line 12) | public Path tempDir(String dirName) throws IOException {
method tempDir (line 16) | public Path tempDir(String dirName, boolean delete) throws IOException {
method deleteDirectory (line 37) | protected static void deleteDirectory(final File directory, boolean de...
method testDummy (line 53) | public void testDummy() throws IOException {
FILE: src/test/java/com/lambdazen/bitsy/RecoveryTest.java
class RecoveryTest (line 11) | public class RecoveryTest extends FileBasedTestCase {
method RecoveryTest (line 12) | public RecoveryTest() {}
method testPartialTx (line 14) | public void testPartialTx() throws Exception {
method checkIterCount (line 55) | private void checkIterCount(Iterator<?> iter, int expectedCount) {
FILE: src/test/java/com/lambdazen/bitsy/ads/dict/DictionaryTest.java
class DictionaryTest (line 8) | public class DictionaryTest extends TestCase {
method testBasicExpandContract (line 11) | public void testBasicExpandContract() {
method testRandomExpandContract (line 163) | public void testRandomExpandContract() {
method randomTestIter (line 168) | public void randomTestIter(int numIters, int numKeys) {
method compareAgainstMap (line 203) | public void compareAgainstMap(Dictionary dict, Map<String, Object> ref...
method getRandomObject (line 216) | public Object getRandomObject() {
FILE: src/test/java/com/lambdazen/bitsy/ads/set/CompactMultiSetMaxTest.java
class CompactMultiSetMaxTest (line 6) | public class CompactMultiSetMaxTest extends TestCase {
method CompactMultiSetMaxTest (line 7) | public CompactMultiSetMaxTest() {}
method testSimpleUse (line 9) | public void testSimpleUse() {
method testResize (line 57) | public void testResize() {
FILE: src/test/java/com/lambdazen/bitsy/ads/set/SetTest.java
class SetTest (line 10) | public class SetTest extends TestCase {
method testBasicExpandContract (line 13) | public void testBasicExpandContract() {
method testRandomExpandContract (line 49) | public void testRandomExpandContract() {
method testClassTypes (line 54) | public void testClassTypes() {
method randomTestIter (line 173) | public void randomTestIter(int numIters, int numKeys) {
method compareAgainstSet (line 205) | public void compareAgainstSet(Object set, java.util.Set<String> refere...
method getRandomObject (line 219) | public Object getRandomObject() {
FILE: src/test/java/com/lambdazen/bitsy/store/EndpointTest.java
class EndpointTest (line 6) | public class EndpointTest extends TestCase {
method EndpointTest (line 7) | public EndpointTest() {}
method testCompare (line 9) | public void testCompare() throws Exception {
FILE: src/test/java/com/lambdazen/bitsy/store/FileBackedMemoryGraphStoreTest.java
class FileBackedMemoryGraphStoreTest (line 19) | public class FileBackedMemoryGraphStoreTest extends FileBasedTestCase {
method FileBackedMemoryGraphStoreTest (line 22) | public FileBackedMemoryGraphStoreTest() {}
method setUp (line 24) | protected void setUp() throws Exception {
method tearDown (line 31) | protected void tearDown() throws Exception {
method testSomething (line 40) | public void testSomething() {
method testVertexInserts (line 49) | public void testVertexInserts() {
method testBipartiteGraph (line 79) | public void testBipartiteGraph() {
method createVertices (line 224) | private List<UUID> createVertices(int numPerCommit, int partSize) {
method deleteVertices (line 238) | private void deleteVertices(UUID[] toDelete, int numPerCommit) {
class VertexCommitChanges (line 248) | public class VertexCommitChanges implements ICommitChanges {
method VertexCommitChanges (line 256) | public VertexCommitChanges(int start, int num) {
method VertexCommitChanges (line 260) | public VertexCommitChanges(int start, int num, UUID[] toDelete) {
method VertexCommitChanges (line 264) | public VertexCommitChanges(int start, int num, UUID[] toDelete, int ...
method getVertexIDs (line 272) | public List<UUID> getVertexIDs() {
method getVertexChanges (line 276) | @Override
method getEdgeChanges (line 310) | @Override
class EdgeCommitChanges (line 316) | public class EdgeCommitChanges implements ICommitChanges {
method EdgeCommitChanges (line 323) | public EdgeCommitChanges() {
method size (line 329) | public int size() {
method addEdge (line 333) | public void addEdge(UUID outUUID, String label, UUID inUUID) {
method getVertexChanges (line 339) | @Override
method getEdgeChanges (line 344) | @Override
FILE: src/test/java/com/lambdazen/bitsy/store/MemoryGraphStoreTest.java
class MemoryGraphStoreTest (line 19) | public class MemoryGraphStoreTest extends TestCase {
method MemoryGraphStoreTest (line 22) | public MemoryGraphStoreTest() {}
method setUp (line 24) | protected void setUp() {
method tearDown (line 30) | protected void tearDown() {
method testSomething (line 38) | public void testSomething() {
method testVertexInserts (line 47) | public void testVertexInserts() {
method testBipartiteGraph (line 77) | public void testBipartiteGraph() {
method createVertices (line 227) | private List<UUID> createVertices(int numPerCommit, int partSize) {
method deleteVertices (line 241) | private void deleteVertices(UUID[] toDelete, int numPerCommit) {
class VertexCommitChanges (line 251) | public class VertexCommitChanges implements ICommitChanges {
method VertexCommitChanges (line 259) | public VertexCommitChanges(int start, int num) {
method VertexCommitChanges (line 263) | public VertexCommitChanges(int start, int num, UUID[] toDelete) {
method VertexCommitChanges (line 267) | public VertexCommitChanges(int start, int num, UUID[] toDelete, int ...
method getVertexIDs (line 275) | public List<UUID> getVertexIDs() {
method getVertexChanges (line 279) | @Override
method getEdgeChanges (line 314) | @Override
class EdgeCommitChanges (line 320) | public class EdgeCommitChanges implements ICommitChanges {
method EdgeCommitChanges (line 327) | public EdgeCommitChanges() {
method size (line 333) | public int size() {
method addEdge (line 337) | public void addEdge(UUID outUUID, String label, UUID inUUID) {
method getVertexChanges (line 343) | @Override
method getEdgeChanges (line 348) | @Override
FILE: src/test/java/com/lambdazen/bitsy/store/RecordTest.java
class RecordTest (line 15) | public class RecordTest extends TestCase {
method RecordTest (line 16) | public RecordTest() {}
method testRecord (line 18) | public void testRecord() throws Exception {
method testDictionaryMaxProperties (line 83) | public void testDictionaryMaxProperties() throws Exception {
FILE: src/test/java/com/lambdazen/bitsy/store/SingleThreadedStringCanonicalizerTest.java
class SingleThreadedStringCanonicalizerTest (line 5) | public class SingleThreadedStringCanonicalizerTest extends TestCase {
method testCanonicalize (line 6) | public void testCanonicalize() {
FILE: src/test/java/com/lambdazen/bitsy/structure/BitsyGraphStructureTestSuite.java
class BitsyGraphStructureTestSuite (line 34) | @RunWith(BitsyGraphStructureTestSuite.class)
method BitsyGraphStructureTestSuite (line 79) | public BitsyGraphStructureTestSuite(final Class<?> klass, final Runner...
FILE: src/test/java/com/lambdazen/bitsy/structure/BitsyProcessStandardTestSuite.java
class BitsyProcessStandardTestSuite (line 64) | @RunWith(BitsyProcessStandardTestSuite.class)
method BitsyProcessStandardTestSuite (line 227) | public BitsyProcessStandardTestSuite(final Class<?> klass, final Runne...
FILE: src/test/java/com/lambdazen/bitsy/structure/BitsyTestGraphProvider.java
class BitsyTestGraphProvider (line 18) | public class BitsyTestGraphProvider extends AbstractGraphProvider {
method clear (line 25) | @Override
method getImplementations (line 39) | @Override
method wipeOut (line 44) | private void wipeOut(File directory) {
method deleteDirectory (line 48) | protected static void deleteDirectory(final File directory, boolean de...
method getBaseConfiguration (line 68) | @Override
FILE: src/test/java/com/lambdazen/bitsy/structure/HasLabelTest.java
class HasLabelTest (line 13) | public class HasLabelTest {
method bitsyPredicateTest (line 14) | @Test
FILE: src/test/java/com/lambdazen/bitsy/util/CommittableFileLogTest.java
class CommittableFileLogTest (line 14) | public class CommittableFileLogTest extends TestCase {
method CommittableFileLogTest (line 15) | public CommittableFileLogTest() {}
method testRead (line 17) | public void testRead() throws Exception {
FILE: src/test/java/com/lambdazen/bitsy/util/DoubleBufferIT.java
class DoubleBufferIT (line 9) | public class DoubleBufferIT extends TestCase {
method DoubleBufferIT (line 14) | public DoubleBufferIT() {}
method testFixedCtBuf (line 16) | public void testFixedCtBuf() throws Exception {
method testException (line 91) | public void testException() throws Exception {
Condensed preview — 194 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,086K chars).
[
{
"path": ".classpath",
"chars": 3489,
"preview": "<classpath>\n <classpathentry kind=\"src\" path=\"src/test/java\" output=\"target/test-classes\" including=\"**/*.java\"/>\n <cl"
},
{
"path": ".git-blame-ignore-revs",
"chars": 79,
"preview": "# reformat with Maveniverse parent 39\n641fdf861487e91b277fda8f06cc852842d14f60\n"
},
{
"path": ".github/dependabot.yml",
"chars": 192,
"preview": "version: 2\nupdates:\n\n- package-ecosystem: \"maven\"\n directory: \"/\"\n schedule:\n interval: \"daily\"\n\n- package-ecosyste"
},
{
"path": ".github/workflows/ci.yml",
"chars": 406,
"preview": "name: CI\n\non:\n push:\n branches:\n - master\n pull_request:\n\njobs:\n build:\n name: Verify\n uses: mavenivers"
},
{
"path": ".gitignore",
"chars": 22,
"preview": "target\n*.iml\n.idea\n*~\n"
},
{
"path": ".mvn/wrapper/maven-wrapper.properties",
"chars": 168,
"preview": "wrapperVersion=3.3.4\ndistributionType=only-script\ndistributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/"
},
{
"path": ".project",
"chars": 510,
"preview": "<projectDescription>\n <name>bitsy</name>\n <comment>Bitsy v3 is a small, fast, embeddable, durable in-memory graph data"
},
{
"path": ".settings/org.eclipse.jdt.core.prefs",
"chars": 203,
"preview": "#Thu Nov 02 18:34:43 EDT 2017\norg.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8\neclipse.preferences.version=1\norg"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "NOTICE",
"chars": 680,
"preview": "This product depends on the following components: \n\n- Tinkerpop Gremlin (gremlin-core, gremlin-test)\n http://tinkerpo"
},
{
"path": "README.md",
"chars": 1163,
"preview": "[](https://s"
},
{
"path": "mvnw",
"chars": 11790,
"preview": "#!/bin/sh\n# ----------------------------------------------------------------------------\n# Licensed to the Apache Softwa"
},
{
"path": "mvnw.cmd",
"chars": 8481,
"preview": "<# : batch portion\r\n@REM ----------------------------------------------------------------------------\r\n@REM Licensed to "
},
{
"path": "pom.xml",
"chars": 8651,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyEdge.java",
"chars": 4401,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.ads.dict.Dictionary;\nimport com.lambdazen.bitsy.store.EdgeBean;"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyElement.java",
"chars": 5678,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.ads.dict.Dictionary;\nimport com.lambdazen.bitsy.ads.dict.Dictio"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyErrorCodes.java",
"chars": 8180,
"preview": "package com.lambdazen.bitsy;\n\npublic enum BitsyErrorCodes {\n INTERNAL_ERROR {\n public String toString() {\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyException.java",
"chars": 663,
"preview": "package com.lambdazen.bitsy;\n\npublic class BitsyException extends RuntimeException {\n private static final long seria"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyFeatures.java",
"chars": 6118,
"preview": "package com.lambdazen.bitsy;\n\nimport org.apache.tinkerpop.gremlin.structure.Graph.Features;\nimport org.apache.tinkerpop."
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyGraph.java",
"chars": 26361,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.gremlin.BitsyTraversalStrategy;\nimport com.lambdazen.bitsy.stor"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyGraphMBean.java",
"chars": 2001,
"preview": "package com.lambdazen.bitsy;\n\npublic interface BitsyGraphMBean {\n /**\n * Returns the reorgFactor which typically "
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyGraphSONModule.java",
"chars": 4434,
"preview": "// Copyright 2017 JanusGraph Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may no"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyIoRegistryV3d0.java",
"chars": 2155,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.store.EdgeBean;\nimport com.lambdazen.bitsy.store.VertexBean;\nim"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyIsolationLevel.java",
"chars": 117,
"preview": "package com.lambdazen.bitsy;\n\npublic enum BitsyIsolationLevel {\n READ_COMMITTED, // default\n REPEATABLE_READ\n}\n"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyProperty.java",
"chars": 1583,
"preview": "package com.lambdazen.bitsy;\n\nimport java.util.NoSuchElementException;\nimport org.apache.tinkerpop.gremlin.structure.Ele"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyRetryException.java",
"chars": 477,
"preview": "package com.lambdazen.bitsy;\n\npublic class BitsyRetryException extends BitsyException {\n private static final long se"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyState.java",
"chars": 114,
"preview": "package com.lambdazen.bitsy;\n\npublic enum BitsyState {\n U, // unmodified\n M, // modified\n D // deleted\n}\n"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyVertex.java",
"chars": 7460,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.ads.dict.Dictionary;\nimport com.lambdazen.bitsy.store.IStringCa"
},
{
"path": "src/main/java/com/lambdazen/bitsy/BitsyVertexProperty.java",
"chars": 1453,
"preview": "package com.lambdazen.bitsy;\n\nimport java.util.Collections;\nimport java.util.Iterator;\nimport java.util.Set;\nimport org."
},
{
"path": "src/main/java/com/lambdazen/bitsy/ICommitChanges.java",
"chars": 203,
"preview": "package com.lambdazen.bitsy;\n\nimport java.util.Collection;\n\npublic interface ICommitChanges {\n public Collection<Bits"
},
{
"path": "src/main/java/com/lambdazen/bitsy/IEdge.java",
"chars": 125,
"preview": "package com.lambdazen.bitsy;\n\npublic interface IEdge {\n public UUID getInVertexId();\n\n public UUID getOutVertexId("
},
{
"path": "src/main/java/com/lambdazen/bitsy/IGraphStore.java",
"chars": 1580,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.store.EdgeBean;\nimport com.lambdazen.bitsy.store.VertexBean;\nim"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ITransaction.java",
"chars": 1419,
"preview": "package com.lambdazen.bitsy;\n\nimport java.util.Iterator;\nimport org.apache.tinkerpop.gremlin.structure.Direction;\nimport"
},
{
"path": "src/main/java/com/lambdazen/bitsy/PortDatabase.java",
"chars": 10667,
"preview": "package com.lambdazen.bitsy;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStream;\nimp"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ThreadedBitsyGraph.java",
"chars": 3699,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.tx.BitsyTransaction;\nimport com.lambdazen.bitsy.tx.BitsyTransac"
},
{
"path": "src/main/java/com/lambdazen/bitsy/UUID.java",
"chars": 2879,
"preview": "package com.lambdazen.bitsy;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\n\n/** This class captures a UUID and is"
},
{
"path": "src/main/java/com/lambdazen/bitsy/UUIDGraphBinarySerializer.java",
"chars": 3093,
"preview": "package com.lambdazen.bitsy;\n\nimport java.io.IOException;\nimport org.apache.tinkerpop.gremlin.structure.io.Buffer;\nimpor"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary.java",
"chars": 656,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\nimport com.lambdazen.bitsy.store.IStringCanonicalizer;\n\n/**\n * This is an re-orga"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary1.java",
"chars": 1315,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\n/** This class implements a dictionary with one element */\npublic class Dictionar"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary11.java",
"chars": 6397,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\npublic class Dictionary11 extends PrimitiveDictionary implements Dictionary {\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary16.java",
"chars": 9179,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\nimport java.util.Arrays;\n\npublic class Dictionary16 extends PrimitiveDictionary i"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary2.java",
"chars": 2140,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\npublic class Dictionary2 extends PrimitiveDictionary implements Dictionary {\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary3.java",
"chars": 2583,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\npublic class Dictionary3 extends PrimitiveDictionary implements Dictionary {\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary4.java",
"chars": 3026,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\npublic class Dictionary4 extends PrimitiveDictionary implements Dictionary {\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary6.java",
"chars": 3845,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\npublic class Dictionary6 extends PrimitiveDictionary implements Dictionary {\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/Dictionary8.java",
"chars": 5060,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\npublic class Dictionary8 extends PrimitiveDictionary implements Dictionary {\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/DictionaryFactory.java",
"chars": 1423,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\nimport java.util.Map;\n\npublic class DictionaryFactory {\n public static Diction"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/DictionaryMax.java",
"chars": 2195,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\nimport java.util.Arrays;\n\npublic class DictionaryMax extends PrimitiveDictionary "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/dict/PrimitiveDictionary.java",
"chars": 4655,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\nimport com.lambdazen.bitsy.store.IStringCanonicalizer;\nimport java.util.Arrays;\n\n"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/ArraySet.java",
"chars": 2169,
"preview": "package com.lambdazen.bitsy.ads.set;\n\nimport java.util.Arrays;\n\n/**\n * This class uses an array-based set implementation"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/ClassifierGetter.java",
"chars": 117,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic interface ClassifierGetter<C, T> {\n public C getClassifier(T obj);\n}\n"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/CompactMultiSetMax.java",
"chars": 5144,
"preview": "package com.lambdazen.bitsy.ads.set;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * The compact multi-set t"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/CompactSet.java",
"chars": 1694,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class CompactSet {\n public static int size(Object set) {\n if (set"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/PrimitiveSet.java",
"chars": 2752,
"preview": "package com.lambdazen.bitsy.ads.set;\n\nimport java.util.Arrays;\n\npublic abstract class PrimitiveSet<T> implements Set<T> "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/Set.java",
"chars": 271,
"preview": "package com.lambdazen.bitsy.ads.set;\n\n/** A bag keeps an unordered, unstable collection of elements */\npublic interface "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/Set12.java",
"chars": 3094,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class Set12<T> extends PrimitiveSet<T> implements Set<T> {\n T elem0, ele"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/Set2.java",
"chars": 998,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class Set2<T> extends PrimitiveSet<T> implements Set<T> {\n T elem0, elem"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/Set24.java",
"chars": 6577,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class Set24<T> extends PrimitiveSet<T> implements Set<T> {\n T elem0,\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/Set3.java",
"chars": 1175,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class Set3<T> extends PrimitiveSet<T> implements Set<T> {\n T elem0, elem"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/Set4.java",
"chars": 1333,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class Set4<T> extends PrimitiveSet<T> implements Set<T> {\n T elem0, elem"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/Set6.java",
"chars": 1614,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class Set6<T> extends PrimitiveSet<T> implements Set<T> {\n T elem0, elem"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/Set8.java",
"chars": 2267,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class Set8<T> extends PrimitiveSet<T> implements Set<T> {\n T elem0, elem"
},
{
"path": "src/main/java/com/lambdazen/bitsy/ads/set/SetMax.java",
"chars": 2197,
"preview": "package com.lambdazen.bitsy.ads.set;\n\npublic class SetMax<T> implements Set<T> {\n private static final long serialVer"
},
{
"path": "src/main/java/com/lambdazen/bitsy/gremlin/BitsyGraphStep.java",
"chars": 6346,
"preview": "package com.lambdazen.bitsy.gremlin;\n\nimport com.lambdazen.bitsy.BitsyGraph;\nimport com.lambdazen.bitsy.wrapper.BitsyAut"
},
{
"path": "src/main/java/com/lambdazen/bitsy/gremlin/BitsyTraversalStrategy.java",
"chars": 2485,
"preview": "package com.lambdazen.bitsy.gremlin;\n\nimport org.apache.tinkerpop.gremlin.process.traversal.Step;\nimport org.apache.tink"
},
{
"path": "src/main/java/com/lambdazen/bitsy/index/BitsyIndex.java",
"chars": 2272,
"preview": "package com.lambdazen.bitsy.index;\n\nimport com.lambdazen.bitsy.ads.set.CompactSet;\nimport java.util.ArrayList;\nimport ja"
},
{
"path": "src/main/java/com/lambdazen/bitsy/index/BitsyIndexMap.java",
"chars": 2045,
"preview": "package com.lambdazen.bitsy.index;\n\nimport com.lambdazen.bitsy.BitsyErrorCodes;\nimport com.lambdazen.bitsy.BitsyExceptio"
},
{
"path": "src/main/java/com/lambdazen/bitsy/index/EdgeIndex.java",
"chars": 659,
"preview": "package com.lambdazen.bitsy.index;\n\nimport com.lambdazen.bitsy.ads.dict.Dictionary;\nimport com.lambdazen.bitsy.store.Edg"
},
{
"path": "src/main/java/com/lambdazen/bitsy/index/EdgeIndexMap.java",
"chars": 393,
"preview": "package com.lambdazen.bitsy.index;\n\nimport com.lambdazen.bitsy.store.EdgeBean;\nimport java.util.Iterator;\n\npublic class "
},
{
"path": "src/main/java/com/lambdazen/bitsy/index/IndexHelper.java",
"chars": 1862,
"preview": "package com.lambdazen.bitsy.index;\n\nimport com.lambdazen.bitsy.BitsyElement;\nimport com.lambdazen.bitsy.BitsyState;\nimpo"
},
{
"path": "src/main/java/com/lambdazen/bitsy/index/VertexIndex.java",
"chars": 648,
"preview": "package com.lambdazen.bitsy.index;\n\nimport com.lambdazen.bitsy.store.VertexBean;\nimport java.util.Iterator;\nimport java."
},
{
"path": "src/main/java/com/lambdazen/bitsy/index/VertexIndexMap.java",
"chars": 409,
"preview": "package com.lambdazen.bitsy.index;\n\nimport com.lambdazen.bitsy.store.VertexBean;\nimport java.util.Iterator;\n\npublic clas"
},
{
"path": "src/main/java/com/lambdazen/bitsy/jsr223/BitsyGremlinPlugin.java",
"chars": 1632,
"preview": "package com.lambdazen.bitsy.jsr223;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyElement;\nimpo"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/AdjacencyMap.java",
"chars": 7223,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.IEdge;\nimport com.lambdazen.bitsy.UUID;\nimport java.util."
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/AdjacencyMapForBeans.java",
"chars": 7491,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.ads.set.ClassifierGetter;\nimport com.lambdazen.bitsy.ads."
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/BackupJob.java",
"chars": 547,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.BitsyException;\nimport java.nio.file.Path;\n\npublic class "
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/CompactAndCopyTask.java",
"chars": 9791,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.BitsyErrorCodes;\nimport com.lambdazen.bitsy.BitsyExceptio"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/EdgeBean.java",
"chars": 2781,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.ann"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/EdgeBeanJson.java",
"chars": 2180,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.an"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/Endpoint.java",
"chars": 3734,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.UUID;\nimport java.io.Serializable;\n\n/** This class repres"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/FileBackedMemoryGraphStore.java",
"chars": 37398,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml.jackson.an"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/IEdgeRemover.java",
"chars": 176,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.IEdge;\nimport com.lambdazen.bitsy.UUID;\n\npublic interface"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/IStringCanonicalizer.java",
"chars": 122,
"preview": "package com.lambdazen.bitsy.store;\n\npublic interface IStringCanonicalizer {\n public String canonicalize(String str);\n"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/ITxBatchJob.java",
"chars": 68,
"preview": "package com.lambdazen.bitsy.store;\n\npublic interface ITxBatchJob {}\n"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/IVeReorgJob.java",
"chars": 68,
"preview": "package com.lambdazen.bitsy.store;\n\npublic interface IVeReorgJob {}\n"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/IndexBean.java",
"chars": 1181,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.an"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/JobWithCountDownLatch.java",
"chars": 305,
"preview": "package com.lambdazen.bitsy.store;\n\nimport java.util.concurrent.CountDownLatch;\n\npublic class JobWithCountDownLatch {\n "
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/LoadTask.java",
"chars": 11546,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.dat"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/MemoryGraphStore.java",
"chars": 19521,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyErrorCodes;\nim"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/ParallelRecordReader.java",
"chars": 6768,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fasterxml.jack"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/Record.java",
"chars": 9991,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.core.JsonFactory;\nimport com.fasterxml.jackson.core.Jso"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/RecordReader.java",
"chars": 865,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.databind.ObjectReader;\nimport com.lambdazen.bitsy.util."
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/SingleThreadedStringCanonicalizer.java",
"chars": 643,
"preview": "package com.lambdazen.bitsy.store;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\n/* This class is not thread-safe */"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/TxBatch.java",
"chars": 550,
"preview": "package com.lambdazen.bitsy.store;\n\nimport java.util.List;\n\n/**\n * This class captures a list of transactions that must "
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/TxLog.java",
"chars": 598,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.util.CommittableFileLog;\n\n/**\n * This class captures a tr"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/TxLogFlushPotential.java",
"chars": 1568,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.store.FileBackedMemoryGraphStore.FlushNowJob;\nimport com."
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/TxUnit.java",
"chars": 1378,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.BitsyException;\nimport com.lambdazen.bitsy.util.Committab"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/VEObsolescencePotential.java",
"chars": 1828,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.util.BufferPotential;\nimport org.slf4j.Logger;\nimport org"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/VertexBean.java",
"chars": 2167,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.annotation.JsonIgnore;\nimport com.fasterxml.jackson.ann"
},
{
"path": "src/main/java/com/lambdazen/bitsy/store/VertexBeanJson.java",
"chars": 1856,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.fasterxml.jackson.an"
},
{
"path": "src/main/java/com/lambdazen/bitsy/tx/BitsyTransaction.java",
"chars": 19942,
"preview": "package com.lambdazen.bitsy.tx;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyElement;\nimport c"
},
{
"path": "src/main/java/com/lambdazen/bitsy/tx/BitsyTransactionContext.java",
"chars": 3933,
"preview": "package com.lambdazen.bitsy.tx;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyException;\nimport"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/BitsyElementIterator.java",
"chars": 3613,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyElement;\nimport com.lambdazen.bitsy.BitsyState;\nimpor"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/BufferFlusher.java",
"chars": 534,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyException;\nimport com.lambdazen.bitsy.util.DoubleBuff"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/BufferPotential.java",
"chars": 802,
"preview": "package com.lambdazen.bitsy.util;\n\n/**\n * This interface represents a buffer potential that will be updated on each\n * e"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/BufferQueuer.java",
"chars": 474,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyException;\nimport com.lambdazen.bitsy.util.DoubleBuff"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/CommittableFileLog.java",
"chars": 13003,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyErrorCodes;\nimport com.lambdazen.bitsy.BitsyException"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/DefaultCommitChanges.java",
"chars": 1211,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyException;\nimpo"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/DoubleBuffer.java",
"chars": 4642,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyException;\nimport java.util.ArrayList;\nimport java.ut"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/DoubleBufferThread.java",
"chars": 2548,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyErrorCodes;\nimport com.lambdazen.bitsy.BitsyException"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/DoubleBufferWithExecWork.java",
"chars": 1083,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyException;\n\npublic class DoubleBufferWithExecWork<T> "
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/EdgeIterator.java",
"chars": 1073,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.UUID;\nimport com.lam"
},
{
"path": "src/main/java/com/lambdazen/bitsy/util/VertexIterator.java",
"chars": 1137,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyVertex;\nimport com.lambdazen.bitsy.UUID;\nimport com.l"
},
{
"path": "src/main/java/com/lambdazen/bitsy/wrapper/BitsyAutoReloadingEdge.java",
"chars": 2021,
"preview": "package com.lambdazen.bitsy.wrapper;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyGraph;\nimpor"
},
{
"path": "src/main/java/com/lambdazen/bitsy/wrapper/BitsyAutoReloadingGraph.java",
"chars": 3561,
"preview": "package com.lambdazen.bitsy.wrapper;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyGraph;\nimpor"
},
{
"path": "src/main/java/com/lambdazen/bitsy/wrapper/BitsyAutoReloadingVertex.java",
"chars": 2960,
"preview": "package com.lambdazen.bitsy.wrapper;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyGraph;\nimpor"
},
{
"path": "src/main/resources/META-INF/services/org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin",
"chars": 46,
"preview": "com.lambdazen.bitsy.jsr223.BitsyGremlinPlugin\n"
},
{
"path": "src/test/java/com/lambdazen/bitsy/BitsyGraphIT.java",
"chars": 84389,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.store.FileBackedMemoryGraphStore;\nimport com.lambdazen.bitsy.ut"
},
{
"path": "src/test/java/com/lambdazen/bitsy/BitsyMemGraphIT.java",
"chars": 3803,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.store.Record;\nimport com.lambdazen.bitsy.store.Record.RecordTyp"
},
{
"path": "src/test/java/com/lambdazen/bitsy/FileBasedTestCase.java",
"chars": 1661,
"preview": "package com.lambdazen.bitsy;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.net.URL;\nimport java.nio.file"
},
{
"path": "src/test/java/com/lambdazen/bitsy/RecoveryTest.java",
"chars": 2342,
"preview": "package com.lambdazen.bitsy;\n\nimport com.lambdazen.bitsy.store.LoadTask;\nimport java.net.URL;\nimport java.nio.file.Files"
},
{
"path": "src/test/java/com/lambdazen/bitsy/ads/dict/DictionaryTest.java",
"chars": 8368,
"preview": "package com.lambdazen.bitsy.ads.dict;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Random;\nimport j"
},
{
"path": "src/test/java/com/lambdazen/bitsy/ads/set/CompactMultiSetMaxTest.java",
"chars": 4714,
"preview": "package com.lambdazen.bitsy.ads.set;\n\nimport java.util.Arrays;\nimport junit.framework.TestCase;\n\npublic class CompactMul"
},
{
"path": "src/test/java/com/lambdazen/bitsy/ads/set/SetTest.java",
"chars": 7822,
"preview": "package com.lambdazen.bitsy.ads.set;\n\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.HashSet;\ni"
},
{
"path": "src/test/java/com/lambdazen/bitsy/store/EndpointTest.java",
"chars": 3110,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.UUID;\nimport junit.framework.TestCase;\n\npublic class Endp"
},
{
"path": "src/test/java/com/lambdazen/bitsy/store/FileBackedMemoryGraphStoreTest.java",
"chars": 17075,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyState;\nimport "
},
{
"path": "src/test/java/com/lambdazen/bitsy/store/MemoryGraphStoreTest.java",
"chars": 17103,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.lambdazen.bitsy.BitsyEdge;\nimport com.lambdazen.bitsy.BitsyState;\nimport "
},
{
"path": "src/test/java/com/lambdazen/bitsy/store/RecordTest.java",
"chars": 5513,
"preview": "package com.lambdazen.bitsy.store;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.fasterxml.jackson.dat"
},
{
"path": "src/test/java/com/lambdazen/bitsy/store/SingleThreadedStringCanonicalizerTest.java",
"chars": 587,
"preview": "package com.lambdazen.bitsy.store;\n\nimport junit.framework.TestCase;\n\npublic class SingleThreadedStringCanonicalizerTest"
},
{
"path": "src/test/java/com/lambdazen/bitsy/structure/BitsyGraphStructureTestSuite.java",
"chars": 3190,
"preview": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOT"
},
{
"path": "src/test/java/com/lambdazen/bitsy/structure/BitsyProcessStandardTestSuite.java",
"chars": 10642,
"preview": "package com.lambdazen.bitsy.structure;\n\nimport com.lambdazen.bitsy.BitsyGraph;\nimport org.apache.tinkerpop.gremlin.Abstr"
},
{
"path": "src/test/java/com/lambdazen/bitsy/structure/BitsyTestGraphProvider.java",
"chars": 3434,
"preview": "package com.lambdazen.bitsy.structure;\n\nimport com.lambdazen.bitsy.BitsyGraph;\nimport com.lambdazen.bitsy.BitsyIsolation"
},
{
"path": "src/test/java/com/lambdazen/bitsy/structure/HasLabelTest.java",
"chars": 1090,
"preview": "package com.lambdazen.bitsy.structure;\n\nimport static org.junit.Assert.assertTrue;\n\nimport com.lambdazen.bitsy.BitsyGrap"
},
{
"path": "src/test/java/com/lambdazen/bitsy/util/CommittableFileLogTest.java",
"chars": 3410,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.store.FileBackedMemoryGraphStore;\nimport java.io.BufferedR"
},
{
"path": "src/test/java/com/lambdazen/bitsy/util/DoubleBufferIT.java",
"chars": 6841,
"preview": "package com.lambdazen.bitsy.util;\n\nimport com.lambdazen.bitsy.BitsyErrorCodes;\nimport com.lambdazen.bitsy.BitsyException"
},
{
"path": "src/test/resources/com/lambdazen/bitsy/util/mobydick.txt",
"chars": 1227205,
"preview": "\n A Plough Boy Edition\n\n\n Contents\n \n Herman Melville\n \n About the\n Transcription\n \n Bibliographic\n Descriptio"
},
{
"path": "src/test/resources/gremlin-server/bitsy.properties",
"chars": 214,
"preview": "# Sample configuration for Bitsy in Gremlin server\n# More details on tuning at https://github.com/lambdazen/bitsy/wiki/T"
},
{
"path": "src/test/resources/gremlin-server/gremlin-server-bitsy.yaml",
"chars": 2229,
"preview": "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE f"
},
{
"path": "src/test/resources/recovery/stage1/eA.txt",
"chars": 26,
"preview": "H=5#0021a643\nL=2#00237762\n"
},
{
"path": "src/test/resources/recovery/stage1/eB.txt",
"chars": 13,
"preview": "H=6#0021a662\n"
},
{
"path": "src/test/resources/recovery/stage1/metaA.txt",
"chars": 28,
"preview": "H=7#0021a681\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage1/metaB.txt",
"chars": 28,
"preview": "H=8#0021a6a0\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage1/txA.txt",
"chars": 13,
"preview": "H=9#0021a6bf\n"
},
{
"path": "src/test/resources/recovery/stage1/txB.txt",
"chars": 10936,
"preview": "H=2#0021a5e6\nV={\"id\":\"88617055-986f-43f2-9eb7-bf42fd8e152d\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#0299675"
},
{
"path": "src/test/resources/recovery/stage1/vA.txt",
"chars": 26,
"preview": "H=3#0021a605\nL=2#00237762\n"
},
{
"path": "src/test/resources/recovery/stage1/vB.txt",
"chars": 13,
"preview": "H=4#0021a624\n"
},
{
"path": "src/test/resources/recovery/stage2/eA.txt",
"chars": 26,
"preview": "H=5#0021a643\nL=2#00237762\n"
},
{
"path": "src/test/resources/recovery/stage2/eB.txt",
"chars": 13,
"preview": "H=6#0021a662\n"
},
{
"path": "src/test/resources/recovery/stage2/metaA.txt",
"chars": 28,
"preview": "H=7#0021a681\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage2/metaB.txt",
"chars": 28,
"preview": "H=8#0021a6a0\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage2/txA.txt",
"chars": 13,
"preview": "H=9#0021a6bf\n"
},
{
"path": "src/test/resources/recovery/stage2/txB.txt",
"chars": 6551,
"preview": "H=2#0021a5e6\nV={\"id\":\"88617055-986f-43f2-9eb7-bf42fd8e152d\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#0299675"
},
{
"path": "src/test/resources/recovery/stage2/vA.txt",
"chars": 26,
"preview": "H=3#0021a605\nL=2#00237762\n"
},
{
"path": "src/test/resources/recovery/stage2/vB.txt",
"chars": 13,
"preview": "H=4#0021a624\n"
},
{
"path": "src/test/resources/recovery/stage3/eA.txt",
"chars": 26,
"preview": "H=5#0021a643\nL=2#00237762\n"
},
{
"path": "src/test/resources/recovery/stage3/eB.txt",
"chars": 13,
"preview": "H=6#0021a662\n"
},
{
"path": "src/test/resources/recovery/stage3/metaA.txt",
"chars": 28,
"preview": "H=7#0021a681\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage3/metaB.txt",
"chars": 28,
"preview": "H=8#0021a6a0\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage3/txA.txt",
"chars": 13,
"preview": "H=9#0021a6bf\n"
},
{
"path": "src/test/resources/recovery/stage3/txB.txt",
"chars": 5486,
"preview": "H=2#0021a5e6\nV={\"id\":\"88617055-986f-43f2-9eb7-bf42fd8e152d\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#0299675"
},
{
"path": "src/test/resources/recovery/stage3/vA.txt",
"chars": 5476,
"preview": "H=3#0021a605\nV={\"id\":\"4939a570-2fc3-49c4-a88c-8dbf995ca059\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#cbe9c5f"
},
{
"path": "src/test/resources/recovery/stage3/vB.txt",
"chars": 13,
"preview": "H=4#0021a624\n"
},
{
"path": "src/test/resources/recovery/stage4/eA.txt",
"chars": 26,
"preview": "H=5#0021a643\nL=2#00237762\n"
},
{
"path": "src/test/resources/recovery/stage4/eB.txt",
"chars": 13,
"preview": "H=6#0021a662\n"
},
{
"path": "src/test/resources/recovery/stage4/metaA.txt",
"chars": 28,
"preview": "H=7#0021a681\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage4/metaB.txt",
"chars": 28,
"preview": "H=8#0021a6a0\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage4/txA.txt",
"chars": 13,
"preview": "H=9#0021a6bf\n"
},
{
"path": "src/test/resources/recovery/stage4/txB.txt",
"chars": 5486,
"preview": "H=2#0021a5e6\nV={\"id\":\"88617055-986f-43f2-9eb7-bf42fd8e152d\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#0299675"
},
{
"path": "src/test/resources/recovery/stage4/vA.txt",
"chars": 5476,
"preview": "H=3#0021a605\nV={\"id\":\"4939a570-2fc3-49c4-a88c-8dbf995ca059\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#cbe9c5f"
},
{
"path": "src/test/resources/recovery/stage4/vB.txt",
"chars": 13,
"preview": "H=4#0021a624\n"
},
{
"path": "src/test/resources/recovery/stage5/eA.txt",
"chars": 26,
"preview": "H=5#0021a643\nL=2#00237762\n"
},
{
"path": "src/test/resources/recovery/stage5/eB.txt",
"chars": 13,
"preview": "H=6#0021a662\n"
},
{
"path": "src/test/resources/recovery/stage5/metaA.txt",
"chars": 28,
"preview": "H=7#0021a681\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage5/metaB.txt",
"chars": 28,
"preview": "H=8#0021a6a0\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage5/txA.txt",
"chars": 13,
"preview": "H=9#0021a6bf\n"
},
{
"path": "src/test/resources/recovery/stage5/txB.txt",
"chars": 5486,
"preview": "H=2#0021a5e6\nV={\"id\":\"88617055-986f-43f2-9eb7-bf42fd8e152d\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#0299675"
},
{
"path": "src/test/resources/recovery/stage5/vA.txt",
"chars": 3869,
"preview": "H=3#0021a605\nV={\"id\":\"4939a570-2fc3-49c4-a88c-8dbf995ca059\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#cbe9c5f"
},
{
"path": "src/test/resources/recovery/stage5/vB.txt",
"chars": 13,
"preview": "H=4#0021a624\n"
},
{
"path": "src/test/resources/recovery/stage6/eA.txt",
"chars": 18651,
"preview": "H=5#0021a643\nL=2#00237762\nE={\"id\":\"804c73b7-1cd1-45fa-aa03-85d5656131a1\",\"v\":1,\"s\":\"M\",\"o\":\"e1332322-88c0-4468-a862-9f45"
},
{
"path": "src/test/resources/recovery/stage6/eB.txt",
"chars": 18436,
"preview": "H=6#0021a662\nE={\"id\":\"804c73b7-1cd1-45fa-aa03-85d5656131a1\",\"v\":1,\"s\":\"M\",\"o\":\"e1332322-88c0-4468-a862-9f45311067ac\",\"l\""
},
{
"path": "src/test/resources/recovery/stage6/metaA.txt",
"chars": 28,
"preview": "H=7#0021a681\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage6/metaB.txt",
"chars": 28,
"preview": "H=8#0021a6a0\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage6/txA.txt",
"chars": 13,
"preview": "H=9#0021a6bf\n"
},
{
"path": "src/test/resources/recovery/stage6/txB.txt",
"chars": 14,
"preview": "H=10#041314cf\n"
},
{
"path": "src/test/resources/recovery/stage6/vA.txt",
"chars": 11010,
"preview": "H=3#0021a605\nL=2#00237762\nV={\"id\":\"a2be48e3-447e-4b50-9c20-a47f451776ce\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-li"
},
{
"path": "src/test/resources/recovery/stage6/vB.txt",
"chars": 5572,
"preview": "H=4#0021a624\nV={\"id\":\"a2be48e3-447e-4b50-9c20-a47f451776ce\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#d87902c"
},
{
"path": "src/test/resources/recovery/stage7/eA.txt",
"chars": 18651,
"preview": "H=5#0021a643\nL=2#00237762\nE={\"id\":\"804c73b7-1cd1-45fa-aa03-85d5656131a1\",\"v\":1,\"s\":\"M\",\"o\":\"e1332322-88c0-4468-a862-9f45"
},
{
"path": "src/test/resources/recovery/stage7/eB.txt",
"chars": 18638,
"preview": "H=6#0021a662\nE={\"id\":\"804c73b7-1cd1-45fa-aa03-85d5656131a1\",\"v\":1,\"s\":\"M\",\"o\":\"e1332322-88c0-4468-a862-9f45311067ac\",\"l\""
},
{
"path": "src/test/resources/recovery/stage7/metaA.txt",
"chars": 28,
"preview": "H=7#0021a681\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage7/metaB.txt",
"chars": 28,
"preview": "H=8#0021a6a0\nM=1.5#86d7bafb\n"
},
{
"path": "src/test/resources/recovery/stage7/txA.txt",
"chars": 13,
"preview": "H=9#0021a6bf\n"
},
{
"path": "src/test/resources/recovery/stage7/txB.txt",
"chars": 14,
"preview": "H=10#041314cf\n"
},
{
"path": "src/test/resources/recovery/stage7/vA.txt",
"chars": 0,
"preview": ""
},
{
"path": "src/test/resources/recovery/stage7/vB.txt",
"chars": 10997,
"preview": "H=4#0021a624\nV={\"id\":\"a2be48e3-447e-4b50-9c20-a47f451776ce\",\"v\":1,\"s\":\"M\",\"p\":{\"foo\":\"something \\n multi-line\"}}#d87902c"
}
]
About this extraction
This page contains the full source code of the lambdazen/bitsy GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 194 files (1.9 MB), approximately 528.2k tokens, and a symbol index with 1176 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.