-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issues/1968: Custom
GraphDatabaseConfiguration
implementation
- Loading branch information
Showing
3 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...er/src/main/java/org/strongbox/db/server/janusgraph/CustomGraphDatabaseConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.strongbox.db.server.janusgraph; | ||
|
||
import org.janusgraph.diskstorage.Backend; | ||
import org.janusgraph.diskstorage.configuration.ModifiableConfiguration; | ||
import org.janusgraph.diskstorage.configuration.ReadConfiguration; | ||
import org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration; | ||
import org.janusgraph.graphdb.database.idassigner.VertexIDAssigner; | ||
|
||
/** | ||
* @author sbespalov | ||
*/ | ||
public class CustomGraphDatabaseConfiguration extends GraphDatabaseConfiguration | ||
{ | ||
|
||
public CustomGraphDatabaseConfiguration(GraphDatabaseConfiguration target) | ||
{ | ||
super((ReadConfiguration) target.getConfigurationAtOpen(), (ModifiableConfiguration) target.getLocalConfiguration(), | ||
target.getUniqueGraphId(), target.getConfiguration()); | ||
} | ||
|
||
@Override | ||
public VertexIDAssigner getIDAssigner(Backend backend) | ||
{ | ||
return new TransactionalVertexIDAssigner(getConfiguration(), backend.getIDAuthority(), backend.getStoreFeatures()); | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...erver/src/main/java/org/strongbox/db/server/janusgraph/TransactionalVertexIDAssigner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.strongbox.db.server.janusgraph; | ||
|
||
import org.janusgraph.diskstorage.IDAuthority; | ||
import org.janusgraph.diskstorage.configuration.Configuration; | ||
import org.janusgraph.diskstorage.keycolumnvalue.StoreFeatures; | ||
import org.janusgraph.graphdb.database.idassigner.VertexIDAssigner; | ||
|
||
/** | ||
* @author sbespalov | ||
*/ | ||
public class TransactionalVertexIDAssigner extends VertexIDAssigner | ||
{ | ||
|
||
public TransactionalVertexIDAssigner(Configuration config, | ||
IDAuthority idAuthority, | ||
StoreFeatures idAuthFeatures) | ||
{ | ||
super(config, idAuthority, idAuthFeatures); | ||
} | ||
|
||
} |