Store() static private method

static private Store ( KeyFormat keys, Org.Neo4j.Kernel.impl.store.kvstore.KeyValueStoreFile store ) : ReadableState
keys KeyFormat
store Org.Neo4j.Kernel.impl.store.kvstore.KeyValueStoreFile
return ReadableState
Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: ActiveState<Key> rotate(boolean force, RotationStrategy strategy, RotationTimerFactory timerFactory, System.Action<Headers.Builder> headersUpdater) throws java.io.IOException
            internal override ActiveState <Key> Rotate(bool force, RotationStrategy strategy, RotationTimerFactory timerFactory, System.Action <Headers.Builder> headersUpdater)
            {
                if (!force)
                {
                    RotationTimerFactory.RotationTimer rotationTimer = timerFactory.CreateTimer();
                    for (long expected = Threshold - PreState.store.version(), sleep = 10; PreState.applied() < expected; sleep = Math.Min(sleep * 2, 100))
                    {
                        if (rotationTimer.TimedOut)
                        {
                            throw new RotationTimeoutException(Threshold, PreState.store.version(), rotationTimer.ElapsedTimeMillis);
                        }
                        try
                        {
                            Thread.Sleep(sleep);
                        }
                        catch (InterruptedException e)
                        {
                            throw ( InterruptedIOException )(new InterruptedIOException("Rotation was interrupted.")).initCause(e);
                        }
                    }
                }
                Pair <File, KeyValueStoreFile> next = strategy.Next(File(), UpdateHeaders(headersUpdater), KeyFormat().filter(PreState.dataProvider()));

                return(PostState.create(ReadableState.Store(PreState.keyFormat(), next.Other()), next.First(), PreState.versionContextSupplier));
            }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: ActiveState<Key> start(DataInitializer<EntryUpdater<Key>> initializer) throws java.io.IOException
            internal override ActiveState <Key> Start(DataInitializer <EntryUpdater <Key> > initializer)
            {
                if (initializer == null)
                {
                    throw new System.InvalidOperationException("Store needs to be created, and no initializer is given.");
                }
                Pair <File, KeyValueStoreFile> created = InitialState(initializer);

                return(StateFactory.open(ReadableState.Store(KeyFormat(), created.Other()), created.First(), VersionContextSupplier));
            }
Example #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: ProgressiveState<Key> initialize(RotationStrategy rotation) throws java.io.IOException
            internal override ProgressiveState <Key> Initialize(RotationStrategy rotation)
            {
                Pair <File, KeyValueStoreFile> opened = rotation.Open();

                if (opened == null)
                {
                    return(new NeedsCreation <Key>(KeyFormat(), StateFactory, rotation, VersionContextSupplier));
                }
                return(new Prepared <Key>(StateFactory.open(ReadableState.Store(KeyFormat(), opened.Other()), opened.First(), VersionContextSupplier)));
            }