Search in sources :

Example 1 with RetryHandlingFileSystemMasterClient

use of alluxio.client.file.RetryHandlingFileSystemMasterClient in project alluxio by Alluxio.

the class JournalCheckpointIntegrationTest method recoverUfsState.

@Test
public void recoverUfsState() throws Exception {
    FileSystemMasterClient client = new RetryHandlingFileSystemMasterClient(MasterClientContext.newBuilder(ClientContext.create(ServerConfiguration.global())).build());
    client.updateUfsMode(new AlluxioURI(""), UpdateUfsModePOptions.newBuilder().setUfsMode(UfsPMode.READ_ONLY).build());
    backupAndRestore();
    try {
        mCluster.getClient().createDirectory(new AlluxioURI("/test"), CreateDirectoryPOptions.newBuilder().setWriteType(WritePType.THROUGH).build());
        fail("Expected an exception to be thrown");
    } catch (AccessControlException e) {
    // Expected
    }
}
Also used : RetryHandlingFileSystemMasterClient(alluxio.client.file.RetryHandlingFileSystemMasterClient) FileSystemMasterClient(alluxio.client.file.FileSystemMasterClient) RetryHandlingFileSystemMasterClient(alluxio.client.file.RetryHandlingFileSystemMasterClient) AccessControlException(alluxio.exception.AccessControlException) AlluxioURI(alluxio.AlluxioURI) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Test(org.junit.Test)

Example 2 with RetryHandlingFileSystemMasterClient

use of alluxio.client.file.RetryHandlingFileSystemMasterClient in project alluxio by Alluxio.

the class MultiProcessCluster method getClients.

/**
 * @return clients for communicating with the cluster
 */
public synchronized Clients getClients() {
    Preconditions.checkState(mState == State.STARTED, "must be in the started state to create a meta master client, but state was %s", mState);
    MasterClientContext config = MasterClientContext.newBuilder(ClientContext.create(ServerConfiguration.global())).setMasterInquireClient(getMasterInquireClient()).build();
    return new Clients(getFileSystemClient(), new RetryHandlingFileSystemMasterClient(config), new RetryHandlingMetaMasterClient(config), new RetryHandlingBlockMasterClient(config));
}
Also used : RetryHandlingFileSystemMasterClient(alluxio.client.file.RetryHandlingFileSystemMasterClient) MasterClientContext(alluxio.master.MasterClientContext) RetryHandlingMetaMasterClient(alluxio.client.meta.RetryHandlingMetaMasterClient) RetryHandlingBlockMasterClient(alluxio.client.block.RetryHandlingBlockMasterClient)

Example 3 with RetryHandlingFileSystemMasterClient

use of alluxio.client.file.RetryHandlingFileSystemMasterClient in project alluxio by Alluxio.

the class FileSystemAdminShell method loadCommands.

@Override
protected Map<String, Command> loadCommands() {
    ClientContext ctx = ClientContext.create(mConfiguration);
    MasterClientContext masterConfig = MasterClientContext.newBuilder(ctx).build();
    JobMasterClientContext jobMasterConfig = JobMasterClientContext.newBuilder(ctx).build();
    Context adminContext = new Context(new RetryHandlingFileSystemMasterClient(masterConfig), new RetryHandlingBlockMasterClient(masterConfig), new RetryHandlingMetaMasterClient(masterConfig), new RetryHandlingMetaMasterConfigClient(masterConfig), new RetryHandlingMetricsMasterClient(masterConfig), new RetryHandlingJournalMasterClient(masterConfig), new RetryHandlingJournalMasterClient(jobMasterConfig), new RetryHandlingJobMasterClient(jobMasterConfig), System.out);
    return CommandUtils.loadCommands(FileSystemAdminShell.class.getPackage().getName(), new Class[] { Context.class, AlluxioConfiguration.class }, new Object[] { mCloser.register(adminContext), mConfiguration });
}
Also used : Context(alluxio.cli.fsadmin.command.Context) MasterClientContext(alluxio.master.MasterClientContext) ClientContext(alluxio.ClientContext) JobMasterClientContext(alluxio.worker.job.JobMasterClientContext) RetryHandlingFileSystemMasterClient(alluxio.client.file.RetryHandlingFileSystemMasterClient) RetryHandlingJournalMasterClient(alluxio.client.journal.RetryHandlingJournalMasterClient) RetryHandlingJobMasterClient(alluxio.client.job.RetryHandlingJobMasterClient) JobMasterClientContext(alluxio.worker.job.JobMasterClientContext) MasterClientContext(alluxio.master.MasterClientContext) ClientContext(alluxio.ClientContext) JobMasterClientContext(alluxio.worker.job.JobMasterClientContext) MasterClientContext(alluxio.master.MasterClientContext) JobMasterClientContext(alluxio.worker.job.JobMasterClientContext) RetryHandlingMetaMasterClient(alluxio.client.meta.RetryHandlingMetaMasterClient) RetryHandlingMetaMasterConfigClient(alluxio.client.meta.RetryHandlingMetaMasterConfigClient) RetryHandlingMetricsMasterClient(alluxio.client.metrics.RetryHandlingMetricsMasterClient) RetryHandlingBlockMasterClient(alluxio.client.block.RetryHandlingBlockMasterClient)

Aggregations

RetryHandlingFileSystemMasterClient (alluxio.client.file.RetryHandlingFileSystemMasterClient)3 RetryHandlingBlockMasterClient (alluxio.client.block.RetryHandlingBlockMasterClient)2 RetryHandlingMetaMasterClient (alluxio.client.meta.RetryHandlingMetaMasterClient)2 MasterClientContext (alluxio.master.MasterClientContext)2 AlluxioURI (alluxio.AlluxioURI)1 ClientContext (alluxio.ClientContext)1 Context (alluxio.cli.fsadmin.command.Context)1 FileSystemMasterClient (alluxio.client.file.FileSystemMasterClient)1 RetryHandlingJobMasterClient (alluxio.client.job.RetryHandlingJobMasterClient)1 RetryHandlingJournalMasterClient (alluxio.client.journal.RetryHandlingJournalMasterClient)1 RetryHandlingMetaMasterConfigClient (alluxio.client.meta.RetryHandlingMetaMasterConfigClient)1 RetryHandlingMetricsMasterClient (alluxio.client.metrics.RetryHandlingMetricsMasterClient)1 AccessControlException (alluxio.exception.AccessControlException)1 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)1 JobMasterClientContext (alluxio.worker.job.JobMasterClientContext)1 Test (org.junit.Test)1