Ejemplo n.º 1
0
 public StoreStreamingProcess(StoreFileStreamingProtocol protocol, System.Func <CheckPointer> checkPointerSupplier, StoreCopyCheckPointMutex mutex, StoreResourceStreamFactory resourceStreamFactory)
 {
     this._protocol             = protocol;
     this._checkPointerSupplier = checkPointerSupplier;
     this._mutex = mutex;
     this._resourceStreamFactory = resourceStreamFactory;
 }
Ejemplo n.º 2
0
 internal StoreCopyRequestHandler(CatchupServerProtocol protocol, System.Func <NeoStoreDataSource> dataSource, CheckPointerService checkPointerService, StoreFileStreamingProtocol storeFileStreamingProtocol, FileSystemAbstraction fs, LogProvider logProvider)
 {
     this._protocol   = protocol;
     this._dataSource = dataSource;
     this._storeFileStreamingProtocol = storeFileStreamingProtocol;
     this._fs  = fs;
     this._log = logProvider.GetLog(typeof(StoreCopyRequestHandler));
     this._checkPointerService = checkPointerService;
 }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldBeAbleToEndWithSuccess()
        public virtual void ShouldBeAbleToEndWithSuccess()
        {
            // given
            StoreFileStreamingProtocol protocol = new StoreFileStreamingProtocol();
            ChannelHandlerContext      ctx      = mock(typeof(ChannelHandlerContext));

            // when
            protocol.End(ctx, StoreCopyFinishedResponse.Status.Success);

            // then
            InOrder inOrder = Mockito.inOrder(ctx);

            inOrder.verify(ctx).write(ResponseMessageType.STORE_COPY_FINISHED);
            inOrder.verify(ctx).writeAndFlush(new StoreCopyFinishedResponse(SUCCESS));
            inOrder.verifyNoMoreInteractions();
        }
Ejemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldStreamResources() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldStreamResources()
        {
            // given
            StoreFileStreamingProtocol protocol = new StoreFileStreamingProtocol();
            ChannelHandlerContext      ctx      = mock(typeof(ChannelHandlerContext));

            Fs.mkdir(new File("dirA"));
            Fs.mkdir(new File("dirB"));

            string[] files = new string[] { "dirA/one", "dirA/two", "dirB/one", "dirB/two", "one", "two", "three" };

            IList <StoreResource> resourceList = new List <StoreResource>();

            foreach (string file in files)
            {
                resourceList.Add(CreateResource(new File(file), ThreadLocalRandom.current().Next(1, 4096)));
            }
            RawCursor <StoreResource, IOException> resources = rawCursorOf(resourceList);

            // when
            while (resources.Next())
            {
                protocol.Stream(ctx, resources.get());
            }

            // then
            InOrder inOrder = Mockito.inOrder(ctx);

            foreach (StoreResource resource in resourceList)
            {
                inOrder.verify(ctx).write(ResponseMessageType.FILE);
                inOrder.verify(ctx).write(new FileHeader(resource.Path(), resource.RecordSize()));
                inOrder.verify(ctx).write(new FileSender(resource));
            }
            verifyNoMoreInteractions(ctx);
        }
Ejemplo n.º 5
0
 public GetIndexSnapshotRequestHandler(CatchupServerProtocol protocol, System.Func <NeoStoreDataSource> dataSource, CheckPointerService checkPointerService, StoreFileStreamingProtocol storeFileStreamingProtocol, FileSystemAbstraction fs, LogProvider logProvider) : base(protocol, dataSource, checkPointerService, storeFileStreamingProtocol, fs, logProvider)
 {
 }
Ejemplo n.º 6
0
 internal EvilStoreCopyRequestHandler(StoreCopyRequestHandlerTest outerInstance, CatchupServerProtocol protocol, System.Func <NeoStoreDataSource> dataSource, StoreFileStreamingProtocol storeFileStreamingProtocol, FileSystemAbstraction fs, LogProvider logProvider) : base(protocol, dataSource, outerInstance.checkPointerService, storeFileStreamingProtocol, fs, logProvider)
 {
     this._outerInstance = outerInstance;
 }