mediachain / L-SPACE

[DEPRECATED] Books = Knowledge = Power = (Mass x Distance^2) / Time^3
MIT License
9 stars 1 forks source link

Helper to obtain migrated OrientGraphFactory with connection pooling #51

Closed yusefnapora closed 8 years ago

yusefnapora commented 8 years ago

In the spirit of smaller branches, this just exposes a new function from MigrationHelper, getMigratedGraphFactory, which will return an OrientGraphFactory with the latest migrations applied.

The plan is to use the connection pool when we set up a server with multiple threads / actors, each of which needs its own OrientGraph instance.

You can pass in an Option[Int] to set the max connection pool size. If that's not set it will use the value of the ORIENT_POOL_MAX env var. If neither of those are present, it will default to a pool size of 1.

I also renamed getMigratedPersistentGraph to getMigratedGraph, and refactored it to call through to getMigratedGraphFactory (with the default pool size). The newInMemoryGraph function now also calls through to getMigratedGraph instead of duplicating the migration logic.

parkan commented 8 years ago

lgtm