Search in sources :

Example 1 with EmbeddedNoExceptionChannel

use of alluxio.EmbeddedNoExceptionChannel in project alluxio by Alluxio.

the class DataServerBlockReadHandlerTest method before.

@Before
public void before() throws Exception {
    ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.ADVANCED);
    mBlockWorker = Mockito.mock(BlockWorker.class);
    Mockito.doNothing().when(mBlockWorker).accessBlock(Mockito.anyLong(), Mockito.anyLong());
    mChannel = new EmbeddedChannel(new DataServerBlockReadHandler(NettyExecutors.BLOCK_READER_EXECUTOR, mBlockWorker, FileTransferType.MAPPED));
    mChannelNoException = new EmbeddedNoExceptionChannel(new DataServerBlockReadHandler(NettyExecutors.BLOCK_READER_EXECUTOR, mBlockWorker, FileTransferType.MAPPED));
}
Also used : EmbeddedNoExceptionChannel(alluxio.EmbeddedNoExceptionChannel) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) BlockWorker(alluxio.worker.block.BlockWorker) Before(org.junit.Before)

Example 2 with EmbeddedNoExceptionChannel

use of alluxio.EmbeddedNoExceptionChannel in project alluxio by Alluxio.

the class DataServerUFSFileReadHandlerTest method before.

@Before
public void before() throws Exception {
    ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.ADVANCED);
    mFileSystemWorker = Mockito.mock(FileSystemWorker.class);
    mChannel = new EmbeddedChannel(new DataServerUFSFileReadHandler(NettyExecutors.UFS_BLOCK_READER_EXECUTOR, mFileSystemWorker));
    mChannelNoException = new EmbeddedNoExceptionChannel(new DataServerUFSFileReadHandler(NettyExecutors.UFS_BLOCK_READER_EXECUTOR, mFileSystemWorker));
}
Also used : FileSystemWorker(alluxio.worker.file.FileSystemWorker) EmbeddedNoExceptionChannel(alluxio.EmbeddedNoExceptionChannel) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) Before(org.junit.Before)

Example 3 with EmbeddedNoExceptionChannel

use of alluxio.EmbeddedNoExceptionChannel in project alluxio by Alluxio.

the class DataServerUFSFileWriteHandlerTest method before.

@Before
public void before() throws Exception {
    mFileSystemWorker = Mockito.mock(FileSystemWorker.class);
    mFile = mTestFolder.newFile().getPath();
    mOutputStream = new FileOutputStream(mFile);
    Mockito.when(mFileSystemWorker.getUfsOutputStream(Mockito.anyLong())).thenReturn(mOutputStream);
    mChecksum = 0;
    mChannel = new EmbeddedChannel(new DataServerUFSFileWriteHandler(NettyExecutors.FILE_WRITER_EXECUTOR, mFileSystemWorker));
    mChannelNoException = new EmbeddedNoExceptionChannel(new DataServerUFSFileWriteHandler(NettyExecutors.FILE_WRITER_EXECUTOR, mFileSystemWorker));
}
Also used : FileSystemWorker(alluxio.worker.file.FileSystemWorker) FileOutputStream(java.io.FileOutputStream) EmbeddedNoExceptionChannel(alluxio.EmbeddedNoExceptionChannel) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) Before(org.junit.Before)

Example 4 with EmbeddedNoExceptionChannel

use of alluxio.EmbeddedNoExceptionChannel in project alluxio by Alluxio.

the class DataServerBlockWriteHandlerTest method before.

@Before
public void before() throws Exception {
    mBlockWorker = Mockito.mock(BlockWorker.class);
    Mockito.doNothing().when(mBlockWorker).createBlockRemote(Mockito.anyLong(), Mockito.anyLong(), Mockito.anyString(), Mockito.anyLong());
    Mockito.doNothing().when(mBlockWorker).requestSpace(Mockito.anyLong(), Mockito.anyLong(), Mockito.anyLong());
    mFile = mTestFolder.newFile().getPath();
    mBlockWriter = new LocalFileBlockWriter(mFile);
    Mockito.when(mBlockWorker.getTempBlockWriterRemote(Mockito.anyLong(), Mockito.anyLong())).thenReturn(mBlockWriter);
    mChecksum = 0;
    mChannel = new EmbeddedChannel(new DataServerBlockWriteHandler(NettyExecutors.BLOCK_WRITER_EXECUTOR, mBlockWorker));
    mChannelNoException = new EmbeddedNoExceptionChannel(new DataServerBlockWriteHandler(NettyExecutors.BLOCK_WRITER_EXECUTOR, mBlockWorker));
}
Also used : LocalFileBlockWriter(alluxio.worker.block.io.LocalFileBlockWriter) EmbeddedNoExceptionChannel(alluxio.EmbeddedNoExceptionChannel) EmbeddedChannel(io.netty.channel.embedded.EmbeddedChannel) BlockWorker(alluxio.worker.block.BlockWorker) Before(org.junit.Before)

Aggregations

EmbeddedNoExceptionChannel (alluxio.EmbeddedNoExceptionChannel)4 EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)4 Before (org.junit.Before)4 BlockWorker (alluxio.worker.block.BlockWorker)2 FileSystemWorker (alluxio.worker.file.FileSystemWorker)2 LocalFileBlockWriter (alluxio.worker.block.io.LocalFileBlockWriter)1 FileOutputStream (java.io.FileOutputStream)1