/** * Creates a new instance of {@link WebInterfaceGeneralServlet}. * * @param masterProcess Alluxio master process */ public WebInterfaceGeneralServlet(MasterProcess masterProcess) { mMasterProcess = masterProcess; mMetaMaster = mMasterProcess.getMaster(MetaMaster.class); }
/** * Constructs a new {@link AlluxioMasterRestServiceHandler}. * * @param context context for the servlet */ public AlluxioMasterRestServiceHandler(@Context ServletContext context) { // Poor man's dependency injection through the Jersey application scope. mMasterProcess = (MasterProcess) context .getAttribute(MasterWebServer.ALLUXIO_MASTER_SERVLET_RESOURCE_KEY); mBlockMaster = mMasterProcess.getMaster(BlockMaster.class); mFileSystemMaster = mMasterProcess.getMaster(FileSystemMaster.class); }
/** * Constructs a new {@link FileSystemMasterClientRestServiceHandler}. * * @param context context for the servlet */ public FileSystemMasterClientRestServiceHandler(@Context ServletContext context) { // Poor man's dependency injection through the Jersey application scope. mFileSystemMaster = ((MasterProcess) context .getAttribute(MasterWebServer.ALLUXIO_MASTER_SERVLET_RESOURCE_KEY)) .getMaster(FileSystemMaster.class); }
/** * Constructs a new {@link LineageMasterClientRestServiceHandler}. * * @param context context for the servlet */ public LineageMasterClientRestServiceHandler(@Context ServletContext context) { // Poor man's dependency injection through the Jersey application scope. mLineageMaster = ((MasterProcess) context .getAttribute(MasterWebServer.ALLUXIO_MASTER_SERVLET_RESOURCE_KEY)) .getMaster(LineageMaster.class); }
/** * Constructs a new {@link BlockMasterClientRestServiceHandler}. * * @param context context for the servlet */ public BlockMasterClientRestServiceHandler(@Context ServletContext context) { // Poor man's dependency injection through the Jersey application scope. mBlockMaster = ((MasterProcess) context .getAttribute(MasterWebServer.ALLUXIO_MASTER_SERVLET_RESOURCE_KEY)) .getMaster(BlockMaster.class); }
/** * Lists the {@link StorageTierInfo} objects of each storage level alias. * * @return the list of {@link StorageTierInfo} objects, in order from highest tier to lowest */ private StorageTierInfo[] generateOrderedStorageTierInfo() { BlockMaster blockMaster = mMasterProcess.getMaster(BlockMaster.class); StorageTierAssoc globalStorageTierAssoc = blockMaster.getGlobalStorageTierAssoc(); List<StorageTierInfo> infos = new ArrayList<>(); Map<String, Long> totalBytesOnTiers = blockMaster.getTotalBytesOnTiers(); Map<String, Long> usedBytesOnTiers = blockMaster.getUsedBytesOnTiers(); for (int ordinal = 0; ordinal < globalStorageTierAssoc.size(); ordinal++) { String tierAlias = globalStorageTierAssoc.getAlias(ordinal); if (totalBytesOnTiers.containsKey(tierAlias) && totalBytesOnTiers.get(tierAlias) > 0) { StorageTierInfo info = new StorageTierInfo(tierAlias, totalBytesOnTiers.get(tierAlias), usedBytesOnTiers.get(tierAlias)); infos.add(info); } } return infos.toArray(new StorageTierInfo[infos.size()]); }
private void setUfsAttributes(HttpServletRequest request) { FileSystemMaster fsMaster = mMasterProcess.getMaster(FileSystemMaster.class); Map<String, MountPointInfo> mountPoints = fsMaster.getMountTable(); MountPointInfo mountInfo = mountPoints.get(MountTable.ROOT);
Configuration.getBoolean(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_ENABLED)); FileSystemMaster fileSystemMaster = mMasterProcess.getMaster(FileSystemMaster.class);
for (FileBlockInfo fileBlockInfo : mMasterProcess.getMaster(FileSystemMaster.class) .getFileBlockInfoList(path)) { uiBlockInfo.add(new UIFileBlockInfo(fileBlockInfo)); request.setAttribute("fileData", fileData); request.setAttribute("highestTierAlias", mMasterProcess.getMaster(BlockMaster.class).getGlobalStorageTierAssoc().getAlias(0));
request.setAttribute("currentPath", currentPath.toString()); request.setAttribute("viewingOffset", 0); FileSystemMaster fileSystemMaster = mMasterProcess.getMaster(FileSystemMaster.class);
"/home"); mWebAppContext.addServlet(new ServletHolder( new WebInterfaceWorkersServlet(masterProcess.getMaster(BlockMaster.class))), "/workers"); mWebAppContext.addServlet(new ServletHolder(new WebInterfaceConfigurationServlet( masterProcess.getMaster(FileSystemMaster.class), masterProcess.getMaster(MetaMaster.class))), "/configuration"); mWebAppContext .addServlet(new ServletHolder(new WebInterfaceBrowseServlet(masterProcess)), "/browse"); "/dependency"); mWebAppContext.addServlet(new ServletHolder( new WebInterfaceDownloadServlet(masterProcess.getMaster(FileSystemMaster.class))), "/download"); mWebAppContext
throws FileDoesNotExistException, InvalidPathException, AccessControlException, UnavailableException { FileSystemMaster fileSystemMaster = mMasterProcess.getMaster(FileSystemMaster.class); if (path.isRoot()) { request.setAttribute("pathInfos", new UIFileInfo[0]);