Search in sources :

Example 1 with FileBlockInfo

use of alluxio.wire.FileBlockInfo in project alluxio by Alluxio.

the class WebInterfaceBrowseServlet method doGet.

/**
   * Populates attribute fields with data from the MasterInfo associated with this servlet. Errors
   * will be displayed in an error field. Debugging can be enabled to display additional data. Will
   * eventually redirect the request to a jsp.
   *
   * @param request the {@link HttpServletRequest} object
   * @param response the {@link HttpServletResponse} object
   * @throws ServletException if the target resource throws this exception
   * @throws IOException if the target resource throws this exception
   */
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    if (SecurityUtils.isSecurityEnabled() && AuthenticatedClientUser.get() == null) {
        AuthenticatedClientUser.set(LoginUser.get().getName());
    }
    request.setAttribute("debug", Configuration.getBoolean(PropertyKey.DEBUG));
    request.setAttribute("showPermissions", Configuration.getBoolean(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_ENABLED));
    request.setAttribute("masterNodeAddress", mMaster.getRpcAddress().toString());
    request.setAttribute("invalidPathError", "");
    List<FileInfo> filesInfo;
    String requestPath = request.getParameter("path");
    if (requestPath == null || requestPath.isEmpty()) {
        requestPath = AlluxioURI.SEPARATOR;
    }
    AlluxioURI currentPath = new AlluxioURI(requestPath);
    request.setAttribute("currentPath", currentPath.toString());
    request.setAttribute("viewingOffset", 0);
    try {
        long fileId = mMaster.getFileSystemMaster().getFileId(currentPath);
        FileInfo fileInfo = mMaster.getFileSystemMaster().getFileInfo(fileId);
        UIFileInfo currentFileInfo = new UIFileInfo(fileInfo);
        if (currentFileInfo.getAbsolutePath() == null) {
            throw new FileDoesNotExistException(currentPath.toString());
        }
        request.setAttribute("currentDirectory", currentFileInfo);
        request.setAttribute("blockSizeBytes", currentFileInfo.getBlockSizeBytes());
        if (!currentFileInfo.getIsDirectory()) {
            String offsetParam = request.getParameter("offset");
            long relativeOffset = 0;
            long offset;
            try {
                if (offsetParam != null) {
                    relativeOffset = Long.parseLong(offsetParam);
                }
            } catch (NumberFormatException e) {
                relativeOffset = 0;
            }
            String endParam = request.getParameter("end");
            // relative to the end of the file.
            if (endParam == null) {
                offset = relativeOffset;
            } else {
                offset = fileInfo.getLength() - relativeOffset;
            }
            if (offset < 0) {
                offset = 0;
            } else if (offset > fileInfo.getLength()) {
                offset = fileInfo.getLength();
            }
            try {
                displayFile(new AlluxioURI(currentFileInfo.getAbsolutePath()), request, offset);
            } catch (AlluxioException e) {
                throw new IOException(e);
            }
            request.setAttribute("viewingOffset", offset);
            getServletContext().getRequestDispatcher("/viewFile.jsp").forward(request, response);
            return;
        }
        setPathDirectories(currentPath, request);
        filesInfo = mMaster.getFileSystemMaster().listStatus(currentPath, ListStatusOptions.defaults().setLoadMetadataType(LoadMetadataType.Always));
    } catch (FileDoesNotExistException e) {
        request.setAttribute("invalidPathError", "Error: Invalid Path " + e.getMessage());
        getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        return;
    } catch (InvalidPathException e) {
        request.setAttribute("invalidPathError", "Error: Invalid Path " + e.getLocalizedMessage());
        getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        return;
    } catch (IOException e) {
        request.setAttribute("invalidPathError", "Error: File " + currentPath + " is not available " + e.getMessage());
        getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        return;
    } catch (AccessControlException e) {
        request.setAttribute("invalidPathError", "Error: File " + currentPath + " cannot be accessed " + e.getMessage());
        getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        return;
    }
    List<UIFileInfo> fileInfos = new ArrayList<>(filesInfo.size());
    for (FileInfo fileInfo : filesInfo) {
        UIFileInfo toAdd = new UIFileInfo(fileInfo);
        try {
            if (!toAdd.getIsDirectory() && fileInfo.getLength() > 0) {
                FileBlockInfo blockInfo = mMaster.getFileSystemMaster().getFileBlockInfoList(new AlluxioURI(toAdd.getAbsolutePath())).get(0);
                List<String> locations = new ArrayList<>();
                // add the in-memory block locations
                for (BlockLocation location : blockInfo.getBlockInfo().getLocations()) {
                    WorkerNetAddress address = location.getWorkerAddress();
                    locations.add(address.getHost() + ":" + address.getDataPort());
                }
                // add underFS locations
                locations.addAll(blockInfo.getUfsLocations());
                toAdd.setFileLocations(locations);
            }
        } catch (FileDoesNotExistException e) {
            request.setAttribute("FileDoesNotExistException", "Error: non-existing file " + e.getMessage());
            getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
            return;
        } catch (InvalidPathException e) {
            request.setAttribute("InvalidPathException", "Error: invalid path " + e.getMessage());
            getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        } catch (AccessControlException e) {
            request.setAttribute("AccessControlException", "Error: File " + currentPath + " cannot be accessed " + e.getMessage());
            getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
            return;
        }
        fileInfos.add(toAdd);
    }
    Collections.sort(fileInfos, UIFileInfo.PATH_STRING_COMPARE);
    request.setAttribute("nTotalFile", fileInfos.size());
    // URL can not determine offset and limit, let javascript in jsp determine and redirect
    if (request.getParameter("offset") == null && request.getParameter("limit") == null) {
        getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        return;
    }
    try {
        int offset = Integer.parseInt(request.getParameter("offset"));
        int limit = Integer.parseInt(request.getParameter("limit"));
        List<UIFileInfo> sub = fileInfos.subList(offset, offset + limit);
        request.setAttribute("fileInfos", sub);
    } catch (NumberFormatException e) {
        request.setAttribute("fatalError", "Error: offset or limit parse error, " + e.getLocalizedMessage());
        getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        return;
    } catch (IndexOutOfBoundsException e) {
        request.setAttribute("fatalError", "Error: offset or offset + limit is out of bound, " + e.getLocalizedMessage());
        getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        return;
    } catch (IllegalArgumentException e) {
        request.setAttribute("fatalError", e.getLocalizedMessage());
        getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
        return;
    }
    getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response);
}
Also used : FileDoesNotExistException(alluxio.exception.FileDoesNotExistException) ArrayList(java.util.ArrayList) AccessControlException(alluxio.exception.AccessControlException) IOException(java.io.IOException) FileBlockInfo(alluxio.wire.FileBlockInfo) BlockLocation(alluxio.wire.BlockLocation) InvalidPathException(alluxio.exception.InvalidPathException) FileInfo(alluxio.wire.FileInfo) WorkerNetAddress(alluxio.wire.WorkerNetAddress) AlluxioURI(alluxio.AlluxioURI) AlluxioException(alluxio.exception.AlluxioException)

Example 2 with FileBlockInfo

use of alluxio.wire.FileBlockInfo in project alluxio by Alluxio.

the class FileSystemMaster method getFileBlockInfoListInternal.

/**
   * @param inodePath the {@link LockedInodePath} to get the info for
   * @return a list of {@link FileBlockInfo} for all the blocks of the given inode
   * @throws InvalidPathException if the path of the given file is invalid
   */
private List<FileBlockInfo> getFileBlockInfoListInternal(LockedInodePath inodePath) throws InvalidPathException, FileDoesNotExistException {
    InodeFile file = inodePath.getInodeFile();
    List<BlockInfo> blockInfoList = mBlockMaster.getBlockInfoList(file.getBlockIds());
    List<FileBlockInfo> ret = new ArrayList<>();
    for (BlockInfo blockInfo : blockInfoList) {
        ret.add(generateFileBlockInfo(inodePath, blockInfo));
    }
    return ret;
}
Also used : BlockInfo(alluxio.wire.BlockInfo) FileBlockInfo(alluxio.wire.FileBlockInfo) ArrayList(java.util.ArrayList) InodeFile(alluxio.master.file.meta.InodeFile) FileBlockInfo(alluxio.wire.FileBlockInfo)

Example 3 with FileBlockInfo

use of alluxio.wire.FileBlockInfo in project alluxio by Alluxio.

the class AlluxioBlockStoreTest method getInStreamInAlluxioWhenCreateStreamIsFailed.

@Test
public void getInStreamInAlluxioWhenCreateStreamIsFailed() throws Exception {
    int workerCount = 5;
    boolean persisted = false;
    int[] blockLocations = new int[] { 2, 3, 4 };
    Map<Integer, Long> failedWorkers = ImmutableMap.of(0, 3L, 1, 1L, 3, 2L);
    int expectedWorker = 2;
    WorkerNetAddress[] workers = new WorkerNetAddress[workerCount];
    for (int i = 0; i < workers.length - 1; i++) {
        workers[i] = new WorkerNetAddress().setHost(String.format("worker-%d", i));
    }
    workers[workers.length - 1] = new WorkerNetAddress().setHost(WORKER_HOSTNAME_LOCAL);
    when(mContext.acquireBlockWorkerClient(WORKER_NET_ADDRESS_LOCAL)).thenThrow(new UnavailableException("failed to connect to " + WORKER_NET_ADDRESS_LOCAL.getHost()));
    BlockInfo info = new BlockInfo().setBlockId(BLOCK_ID).setLocations(Arrays.stream(blockLocations).mapToObj(x -> new BlockLocation().setWorkerAddress(workers[x])).collect(Collectors.toList()));
    URIStatus dummyStatus = new URIStatus(new FileInfo().setPersisted(persisted).setBlockIds(Collections.singletonList(BLOCK_ID)).setFileBlockInfos(Collections.singletonList(new FileBlockInfo().setBlockInfo(info))));
    BlockLocationPolicy mockPolicy = mock(BlockLocationPolicy.class);
    when(mockPolicy.getWorker(any())).thenAnswer(arg -> arg.getArgument(0, GetWorkerOptions.class).getBlockWorkerInfos().iterator().next().getNetAddress());
    InStreamOptions options = new InStreamOptions(dummyStatus, FileSystemOptions.openFileDefaults(sConf), sConf);
    options.setUfsReadLocationPolicy(mockPolicy);
    when(mMasterClient.getBlockInfo(BLOCK_ID)).thenReturn(info);
    when(mContext.getCachedWorkers()).thenReturn(Arrays.stream(workers).map(x -> new BlockWorkerInfo(x, -1, -1)).collect((Collectors.toList())));
    Map<WorkerNetAddress, Long> failedWorkerAddresses = failedWorkers.entrySet().stream().map(x -> new AbstractMap.SimpleImmutableEntry<>(workers[x.getKey()], x.getValue())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
    BlockInStream inStream = null;
    int i = 2;
    while (i-- > 0) {
        try {
            inStream = mBlockStore.getInStream(BLOCK_ID, options, failedWorkerAddresses);
        } catch (Exception e) {
        // do nothing
        }
    }
    assertEquals(workers[expectedWorker], inStream.getAddress());
}
Also used : Arrays(java.util.Arrays) BlockLocationPolicy(alluxio.client.block.policy.BlockLocationPolicy) BlockInfo(alluxio.wire.BlockInfo) GrpcDataReader(alluxio.client.block.stream.GrpcDataReader) NoopClosableResource(alluxio.client.block.stream.NoopClosableResource) FileBlockInfo(alluxio.wire.FileBlockInfo) PropertyKey(alluxio.conf.PropertyKey) StreamObserver(io.grpc.stub.StreamObserver) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Map(java.util.Map) BlockWorkerDataReader(alluxio.client.block.stream.BlockWorkerDataReader) PreconditionMessage(alluxio.exception.PreconditionMessage) ClientContext(alluxio.ClientContext) BlockWorkerClient(alluxio.client.block.stream.BlockWorkerClient) ImmutableMap(com.google.common.collect.ImmutableMap) Set(java.util.Set) ThreadSafe(javax.annotation.concurrent.ThreadSafe) ClientCallStreamObserver(io.grpc.stub.ClientCallStreamObserver) GetWorkerOptions(alluxio.client.block.policy.options.GetWorkerOptions) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Executors(java.util.concurrent.Executors) List(java.util.List) DummyCloseableResource(alluxio.resource.DummyCloseableResource) ConfigurationTestUtils(alluxio.ConfigurationTestUtils) Mockito.any(org.mockito.Mockito.any) WriteType(alluxio.client.WriteType) InstancedConfiguration(alluxio.conf.InstancedConfiguration) Mockito.mock(org.mockito.Mockito.mock) UnavailableException(alluxio.exception.status.UnavailableException) BlockWorker(alluxio.worker.block.BlockWorker) Assert.assertThrows(org.junit.Assert.assertThrows) WorkerNetAddress(alluxio.wire.WorkerNetAddress) RunWith(org.junit.runner.RunWith) NetworkAddressUtils(alluxio.util.network.NetworkAddressUtils) BlockOutStream(alluxio.client.block.stream.BlockOutStream) HashSet(java.util.HashSet) Answer(org.mockito.stubbing.Answer) InvocationOnMock(org.mockito.invocation.InvocationOnMock) Lists(com.google.common.collect.Lists) ConfigurationRule(alluxio.ConfigurationRule) OpenLocalBlockResponse(alluxio.grpc.OpenLocalBlockResponse) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) CreateLocalBlockResponse(alluxio.grpc.CreateLocalBlockResponse) PowerMockRunner(org.powermock.modules.junit4.PowerMockRunner) TieredIdentityFactory(alluxio.network.TieredIdentityFactory) PowerMockito(org.powermock.api.mockito.PowerMockito) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) BlockInStream(alluxio.client.block.stream.BlockInStream) InStreamOptions(alluxio.client.file.options.InStreamOptions) ExceptionMessage(alluxio.exception.ExceptionMessage) Assert.assertTrue(org.junit.Assert.assertTrue) OutStreamOptions(alluxio.client.file.options.OutStreamOptions) Test(org.junit.Test) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) OpenFilePOptions(alluxio.grpc.OpenFilePOptions) File(java.io.File) OpenLocalBlockRequest(alluxio.grpc.OpenLocalBlockRequest) BlockLocation(alluxio.wire.BlockLocation) Mockito(org.mockito.Mockito) URIStatus(alluxio.client.file.URIStatus) AbstractMap(java.util.AbstractMap) FileSystemContext(alluxio.client.file.FileSystemContext) FileInfo(alluxio.wire.FileInfo) Closeable(java.io.Closeable) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) FileSystemOptions(alluxio.util.FileSystemOptions) UnavailableException(alluxio.exception.status.UnavailableException) GetWorkerOptions(alluxio.client.block.policy.options.GetWorkerOptions) BlockLocation(alluxio.wire.BlockLocation) URIStatus(alluxio.client.file.URIStatus) FileBlockInfo(alluxio.wire.FileBlockInfo) UnavailableException(alluxio.exception.status.UnavailableException) IOException(java.io.IOException) BlockLocationPolicy(alluxio.client.block.policy.BlockLocationPolicy) InStreamOptions(alluxio.client.file.options.InStreamOptions) BlockInStream(alluxio.client.block.stream.BlockInStream) FileInfo(alluxio.wire.FileInfo) WorkerNetAddress(alluxio.wire.WorkerNetAddress) BlockInfo(alluxio.wire.BlockInfo) FileBlockInfo(alluxio.wire.FileBlockInfo) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) AbstractMap(java.util.AbstractMap) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 4 with FileBlockInfo

use of alluxio.wire.FileBlockInfo in project alluxio by Alluxio.

the class AlluxioBlockStoreTest method getInStreamUfsMockLocaltion.

@Test
public void getInStreamUfsMockLocaltion() throws Exception {
    try (Closeable c = new ConfigurationRule(PropertyKey.USER_UFS_BLOCK_READ_LOCATION_POLICY, MockBlockLocationPolicy.class.getTypeName(), sConf).toResource()) {
        WorkerNetAddress worker1 = new WorkerNetAddress().setHost("worker1");
        WorkerNetAddress worker2 = new WorkerNetAddress().setHost("worker2");
        BlockInfo info = new BlockInfo().setBlockId(0);
        URIStatus dummyStatus = new URIStatus(new FileInfo().setPersisted(true).setBlockIds(Collections.singletonList(0L)).setFileBlockInfos(Collections.singletonList(new FileBlockInfo().setBlockInfo(info))));
        OpenFilePOptions readOptions = OpenFilePOptions.newBuilder().build();
        InStreamOptions options = new InStreamOptions(dummyStatus, readOptions, sConf);
        ((MockBlockLocationPolicy) options.getUfsReadLocationPolicy()).setHosts(Arrays.asList(worker1, worker2));
        when(mMasterClient.getBlockInfo(BLOCK_ID)).thenReturn(new BlockInfo());
        when(mContext.getCachedWorkers()).thenReturn(Lists.newArrayList(new BlockWorkerInfo(worker1, -1, -1), new BlockWorkerInfo(worker2, -1, -1)));
        // Location policy chooses worker1 first.
        assertEquals(worker1, mBlockStore.getInStream(BLOCK_ID, options).getAddress());
        // Location policy chooses worker2 second.
        assertEquals(worker2, mBlockStore.getInStream(BLOCK_ID, options).getAddress());
    }
}
Also used : FileInfo(alluxio.wire.FileInfo) WorkerNetAddress(alluxio.wire.WorkerNetAddress) BlockInfo(alluxio.wire.BlockInfo) FileBlockInfo(alluxio.wire.FileBlockInfo) Closeable(java.io.Closeable) URIStatus(alluxio.client.file.URIStatus) FileBlockInfo(alluxio.wire.FileBlockInfo) OpenFilePOptions(alluxio.grpc.OpenFilePOptions) ConfigurationRule(alluxio.ConfigurationRule) InStreamOptions(alluxio.client.file.options.InStreamOptions) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Example 5 with FileBlockInfo

use of alluxio.wire.FileBlockInfo in project alluxio by Alluxio.

the class AlluxioBlockStoreTest method testGetInStreamFallback.

private void testGetInStreamFallback(int workerCount, boolean isPersisted, int[] blockLocations, Map<Integer, Long> failedWorkers, int expectedWorker) throws Exception {
    WorkerNetAddress[] workers = new WorkerNetAddress[workerCount];
    Arrays.setAll(workers, i -> new WorkerNetAddress().setHost(String.format("worker-%d", i)));
    BlockInfo info = new BlockInfo().setBlockId(BLOCK_ID).setLocations(Arrays.stream(blockLocations).mapToObj(x -> new BlockLocation().setWorkerAddress(workers[x])).collect(Collectors.toList()));
    URIStatus dummyStatus = new URIStatus(new FileInfo().setPersisted(isPersisted).setBlockIds(Collections.singletonList(BLOCK_ID)).setFileBlockInfos(Collections.singletonList(new FileBlockInfo().setBlockInfo(info))));
    BlockLocationPolicy mockPolicy = mock(BlockLocationPolicy.class);
    when(mockPolicy.getWorker(any())).thenAnswer(arg -> arg.getArgument(0, GetWorkerOptions.class).getBlockWorkerInfos().iterator().next().getNetAddress());
    InStreamOptions options = new InStreamOptions(dummyStatus, FileSystemOptions.openFileDefaults(sConf), sConf);
    options.setUfsReadLocationPolicy(mockPolicy);
    when(mMasterClient.getBlockInfo(BLOCK_ID)).thenReturn(info);
    when(mContext.getCachedWorkers()).thenReturn(Arrays.stream(workers).map(x -> new BlockWorkerInfo(x, -1, -1)).collect((Collectors.toList())));
    Map<WorkerNetAddress, Long> failedWorkerAddresses = failedWorkers.entrySet().stream().map(x -> new AbstractMap.SimpleImmutableEntry<>(workers[x.getKey()], x.getValue())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
    BlockInStream inStream = mBlockStore.getInStream(BLOCK_ID, options, failedWorkerAddresses);
    assertEquals(workers[expectedWorker], inStream.getAddress());
}
Also used : Arrays(java.util.Arrays) BlockLocationPolicy(alluxio.client.block.policy.BlockLocationPolicy) BlockInfo(alluxio.wire.BlockInfo) GrpcDataReader(alluxio.client.block.stream.GrpcDataReader) NoopClosableResource(alluxio.client.block.stream.NoopClosableResource) FileBlockInfo(alluxio.wire.FileBlockInfo) PropertyKey(alluxio.conf.PropertyKey) StreamObserver(io.grpc.stub.StreamObserver) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Map(java.util.Map) BlockWorkerDataReader(alluxio.client.block.stream.BlockWorkerDataReader) PreconditionMessage(alluxio.exception.PreconditionMessage) ClientContext(alluxio.ClientContext) BlockWorkerClient(alluxio.client.block.stream.BlockWorkerClient) ImmutableMap(com.google.common.collect.ImmutableMap) Set(java.util.Set) ThreadSafe(javax.annotation.concurrent.ThreadSafe) ClientCallStreamObserver(io.grpc.stub.ClientCallStreamObserver) GetWorkerOptions(alluxio.client.block.policy.options.GetWorkerOptions) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) Executors(java.util.concurrent.Executors) List(java.util.List) DummyCloseableResource(alluxio.resource.DummyCloseableResource) ConfigurationTestUtils(alluxio.ConfigurationTestUtils) Mockito.any(org.mockito.Mockito.any) WriteType(alluxio.client.WriteType) InstancedConfiguration(alluxio.conf.InstancedConfiguration) Mockito.mock(org.mockito.Mockito.mock) UnavailableException(alluxio.exception.status.UnavailableException) BlockWorker(alluxio.worker.block.BlockWorker) Assert.assertThrows(org.junit.Assert.assertThrows) WorkerNetAddress(alluxio.wire.WorkerNetAddress) RunWith(org.junit.runner.RunWith) NetworkAddressUtils(alluxio.util.network.NetworkAddressUtils) BlockOutStream(alluxio.client.block.stream.BlockOutStream) HashSet(java.util.HashSet) Answer(org.mockito.stubbing.Answer) InvocationOnMock(org.mockito.invocation.InvocationOnMock) Lists(com.google.common.collect.Lists) ConfigurationRule(alluxio.ConfigurationRule) OpenLocalBlockResponse(alluxio.grpc.OpenLocalBlockResponse) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) AlluxioConfiguration(alluxio.conf.AlluxioConfiguration) CreateLocalBlockResponse(alluxio.grpc.CreateLocalBlockResponse) PowerMockRunner(org.powermock.modules.junit4.PowerMockRunner) TieredIdentityFactory(alluxio.network.TieredIdentityFactory) PowerMockito(org.powermock.api.mockito.PowerMockito) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) BlockInStream(alluxio.client.block.stream.BlockInStream) InStreamOptions(alluxio.client.file.options.InStreamOptions) ExceptionMessage(alluxio.exception.ExceptionMessage) Assert.assertTrue(org.junit.Assert.assertTrue) OutStreamOptions(alluxio.client.file.options.OutStreamOptions) Test(org.junit.Test) IOException(java.io.IOException) Mockito.when(org.mockito.Mockito.when) OpenFilePOptions(alluxio.grpc.OpenFilePOptions) File(java.io.File) OpenLocalBlockRequest(alluxio.grpc.OpenLocalBlockRequest) BlockLocation(alluxio.wire.BlockLocation) Mockito(org.mockito.Mockito) URIStatus(alluxio.client.file.URIStatus) AbstractMap(java.util.AbstractMap) FileSystemContext(alluxio.client.file.FileSystemContext) FileInfo(alluxio.wire.FileInfo) Closeable(java.io.Closeable) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) FileSystemOptions(alluxio.util.FileSystemOptions) GetWorkerOptions(alluxio.client.block.policy.options.GetWorkerOptions) BlockLocation(alluxio.wire.BlockLocation) URIStatus(alluxio.client.file.URIStatus) FileBlockInfo(alluxio.wire.FileBlockInfo) BlockLocationPolicy(alluxio.client.block.policy.BlockLocationPolicy) InStreamOptions(alluxio.client.file.options.InStreamOptions) BlockInStream(alluxio.client.block.stream.BlockInStream) FileInfo(alluxio.wire.FileInfo) WorkerNetAddress(alluxio.wire.WorkerNetAddress) BlockInfo(alluxio.wire.BlockInfo) FileBlockInfo(alluxio.wire.FileBlockInfo) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) AbstractMap(java.util.AbstractMap)

Aggregations

FileBlockInfo (alluxio.wire.FileBlockInfo)42 URIStatus (alluxio.client.file.URIStatus)25 AlluxioURI (alluxio.AlluxioURI)23 FileInfo (alluxio.wire.FileInfo)23 BlockInfo (alluxio.wire.BlockInfo)22 Test (org.junit.Test)19 WorkerNetAddress (alluxio.wire.WorkerNetAddress)16 ArrayList (java.util.ArrayList)16 BlockLocation (alluxio.wire.BlockLocation)14 OpenFilePOptions (alluxio.grpc.OpenFilePOptions)11 InStreamOptions (alluxio.client.file.options.InStreamOptions)10 IOException (java.io.IOException)9 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)9 Map (java.util.Map)8 BlockWorkerInfo (alluxio.client.block.BlockWorkerInfo)7 PropertyKey (alluxio.conf.PropertyKey)7 FileDoesNotExistException (alluxio.exception.FileDoesNotExistException)7 UnavailableException (alluxio.exception.status.UnavailableException)7 Constants (alluxio.Constants)6 FileInStream (alluxio.client.file.FileInStream)6