Java Code Examples for org.apache.hadoop.io.retry.Idempotent

The following examples show how to use org.apache.hadoop.io.retry.Idempotent. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hadoop   Source File: TestAnnotations.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void checkAnnotations() {
  Method[] methods = NamenodeProtocols.class.getMethods();
  for (Method m : methods) {
    Assert.assertTrue(
        "Idempotent or AtMostOnce annotation is not present " + m,
        m.isAnnotationPresent(Idempotent.class)
            || m.isAnnotationPresent(AtMostOnce.class));
  }
}
 
Example 2
@Public
@Stable
@Idempotent
public RefreshUserToGroupsMappingsResponse refreshUserToGroupsMappings(
    RefreshUserToGroupsMappingsRequest request)
throws StandbyException, YarnException, IOException;
 
Example 3
@Public
@Stable
@Idempotent
public RefreshServiceAclsResponse refreshServiceAcls(
    RefreshServiceAclsRequest request)
throws YarnException, IOException;
 
Example 4
Source Project: hadoop   Source File: DatanodeProtocol.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Commit block synchronization in lease recovery
 */
@Idempotent
public void commitBlockSynchronization(ExtendedBlock block,
    long newgenerationstamp, long newlength,
    boolean closeFile, boolean deleteblock, DatanodeID[] newtargets,
    String[] newtargetstorages) throws IOException;
 
Example 5
@Public
@Evolving
@Idempotent
public ReplaceLabelsOnNodeResponse replaceLabelsOnNode(
    ReplaceLabelsOnNodeRequest request) throws YarnException, IOException;
 
Example 6
Source Project: hadoop   Source File: ClientProtocol.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Get a report on the current datanode storages.
 */
@Idempotent
public DatanodeStorageReport[] getDatanodeStorageReport(
    HdfsConstants.DatanodeReportType type) throws IOException;
 
Example 7
Source Project: hadoop   Source File: DatanodeProtocol.java    License: Apache License 2.0 4 votes vote down vote up
@Idempotent
public NamespaceInfo versionRequest() throws IOException;
 
Example 8
Source Project: hadoop   Source File: ApplicationClientProtocol.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * <p>The interface used by clients to obtain a new {@link ApplicationId} for 
 * submitting new applications.</p>
 * 
 * <p>The <code>ResourceManager</code> responds with a new, monotonically
 * increasing, {@link ApplicationId} which is used by the client to submit
 * a new application.</p>
 *
 * <p>The <code>ResourceManager</code> also responds with details such 
 * as maximum resource capabilities in the cluster as specified in
 * {@link GetNewApplicationResponse}.</p>
 *
 * @param request request to get a new <code>ApplicationId</code>
 * @return response containing the new <code>ApplicationId</code> to be used
 * to submit an application
 * @throws YarnException
 * @throws IOException
 * @see #submitApplication(SubmitApplicationRequest)
 */
@Public
@Stable
@Idempotent
public GetNewApplicationResponse getNewApplication(
    GetNewApplicationRequest request)
throws YarnException, IOException;
 
Example 9
Source Project: hadoop   Source File: ApplicationClientProtocol.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * <p>The interface used by clients to get a report of all nodes
 * in the cluster from the <code>ResourceManager</code>.</p>
 * 
 * <p>The <code>ResourceManager</code> responds with a 
 * {@link GetClusterNodesResponse} which includes the 
 * {@link NodeReport} for all the nodes in the cluster.</p>
 * 
 * @param request request for report on all nodes
 * @return report on all nodes
 * @throws YarnException
 * @throws IOException
 */
@Public
@Stable
@Idempotent
public GetClusterNodesResponse getClusterNodes(
    GetClusterNodesRequest request) 
throws YarnException, IOException;
 
Example 10
Source Project: hadoop   Source File: ApplicationClientProtocol.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * <p>The interface used by clients to get information about <em>queues</em>
 * from the <code>ResourceManager</code>.</p>
 * 
 * <p>The client, via {@link GetQueueInfoRequest}, can ask for details such
 * as used/total resources, child queues, running applications etc.</p>
 *
 * <p> In secure mode,the <code>ResourceManager</code> verifies access before
 * providing the information.</p> 
 * 
 * @param request request to get queue information
 * @return queue information
 * @throws YarnException
 * @throws IOException
 */
@Public
@Stable
@Idempotent
public GetQueueInfoResponse getQueueInfo(
    GetQueueInfoRequest request) 
throws YarnException, IOException;
 
Example 11
Source Project: hadoop   Source File: ApplicationClientProtocol.java    License: Apache License 2.0 3 votes vote down vote up
/**
  * <p>The interface used by clients to get information about <em>queue 
  * acls</em> for <em>current user</em> from the <code>ResourceManager</code>.
  * </p>
  * 
  * <p>The <code>ResourceManager</code> responds with queue acls for all
  * existing queues.</p>
  * 
  * @param request request to get queue acls for <em>current user</em>
  * @return queue acls for <em>current user</em>
  * @throws YarnException
  * @throws IOException
  */
 @Public
 @Stable
@Idempotent
 public GetQueueUserAclsInfoResponse getQueueUserAcls(
     GetQueueUserAclsInfoRequest request) 
 throws YarnException, IOException;
 
Example 12
Source Project: hadoop   Source File: ApplicationBaseProtocol.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * The interface used by clients to get a report of an Application Attempt
 * from the <code>ResourceManager</code> or
 * <code>ApplicationHistoryServer</code>
 * <p>
 * The client, via {@link GetApplicationAttemptReportRequest} provides the
 * {@link ApplicationAttemptId} of the application attempt.
 * <p>
 * In secure mode,the <code>ResourceManager</code> or
 * <code>ApplicationHistoryServer</code> verifies access to the method before
 * accepting the request.
 * <p>
 * The <code>ResourceManager</code> or <code>ApplicationHistoryServer</code>
 * responds with a {@link GetApplicationAttemptReportResponse} which includes
 * the {@link ApplicationAttemptReport} for the application attempt.
 * <p>
 * If the user does not have <code>VIEW_APP</code> access then the following
 * fields in the report will be set to stubbed values:
 * <ul>
 *   <li>host</li>
 *   <li>RPC port</li>
 *   <li>client token</li>
 *   <li>diagnostics - set to "N/A"</li>
 *   <li>tracking URL</li>
 * </ul>
 *
 * @param request
 *          request for an application attempt report
 * @return application attempt report
 * @throws YarnException
 * @throws IOException
 */
@Public
@Unstable
@Idempotent
public GetApplicationAttemptReportResponse getApplicationAttemptReport(
    GetApplicationAttemptReportRequest request) throws YarnException,
    IOException;
 
Example 13
/**
 * <p>The interface used by admin to update nodes' resources to the
 * <code>ResourceManager</code> </p>.
 * 
 * <p>The admin client is required to provide details such as a map from 
 * {@link NodeId} to {@link ResourceOption} required to update resources on 
 * a list of <code>RMNode</code> in <code>ResourceManager</code> etc.
 * via the {@link UpdateNodeResourceRequest}.</p>
 * 
 * @param request request to update resource for a node in cluster.
 * @return (empty) response on accepting update.
 * @throws YarnException
 * @throws IOException
 */
@Public
@Evolving
@Idempotent
public UpdateNodeResourceResponse updateNodeResource(
    UpdateNodeResourceRequest request) 
throws YarnException, IOException;
 
Example 14
Source Project: hadoop   Source File: ClientProtocol.java    License: Apache License 2.0 3 votes vote down vote up
/** 
 * Get a datanode for an existing pipeline.
 * 
 * @param src the file being written
 * @param fileId the ID of the file being written
 * @param blk the block being written
 * @param existings the existing nodes in the pipeline
 * @param excludes the excluded nodes
 * @param numAdditionalNodes number of additional datanodes
 * @param clientName the name of the client
 * 
 * @return the located block.
 * 
 * @throws AccessControlException If access is denied
 * @throws FileNotFoundException If file <code>src</code> is not found
 * @throws SafeModeException create not allowed in safemode
 * @throws UnresolvedLinkException If <code>src</code> contains a symlink
 * @throws IOException If an I/O error occurred
 */
@Idempotent
public LocatedBlock getAdditionalDatanode(final String src,
    final long fileId, final ExtendedBlock blk,
    final DatanodeInfo[] existings,
    final String[] existingStorageIDs,
    final DatanodeInfo[] excludes,
    final int numAdditionalNodes, final String clientName
    ) throws AccessControlException, FileNotFoundException,
        SafeModeException, UnresolvedLinkException, IOException;
 
Example 15
Source Project: hadoop   Source File: ClientProtocol.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * Create a directory (or hierarchy of directories) with the given
 * name and permission.
 *
 * @param src The path of the directory being created
 * @param masked The masked permission of the directory being created
 * @param createParent create missing parent directory if true
 *
 * @return True if the operation success.
 *
 * @throws AccessControlException If access is denied
 * @throws FileAlreadyExistsException If <code>src</code> already exists
 * @throws FileNotFoundException If parent of <code>src</code> does not exist
 *           and <code>createParent</code> is false
 * @throws NSQuotaExceededException If file creation violates quota restriction
 * @throws ParentNotDirectoryException If parent of <code>src</code> 
 *           is not a directory
 * @throws SafeModeException create not allowed in safemode
 * @throws UnresolvedLinkException If <code>src</code> contains a symlink
 * @throws SnapshotAccessControlException if path is in RO snapshot
 * @throws IOException If an I/O error occurred.
 *
 * RunTimeExceptions:
 * @throws InvalidPathException If <code>src</code> is invalid
 */
@Idempotent
public boolean mkdirs(String src, FsPermission masked, boolean createParent)
    throws AccessControlException, FileAlreadyExistsException,
    FileNotFoundException, NSQuotaExceededException,
    ParentNotDirectoryException, SafeModeException, UnresolvedLinkException,
    SnapshotAccessControlException, IOException;
 
Example 16
Source Project: hadoop   Source File: DatanodeProtocol.java    License: Apache License 2.0 3 votes vote down vote up
/**
 * sendHeartbeat() tells the NameNode that the DataNode is still
 * alive and well.  Includes some status info, too. 
 * It also gives the NameNode a chance to return 
 * an array of "DatanodeCommand" objects in HeartbeatResponse.
 * A DatanodeCommand tells the DataNode to invalidate local block(s), 
 * or to copy them to other DataNodes, etc.
 * @param registration datanode registration information
 * @param reports utilization report per storage
 * @param xmitsInProgress number of transfers from this datanode to others
 * @param xceiverCount number of active transceiver threads
 * @param failedVolumes number of failed volumes
 * @param volumeFailureSummary info about volume failures
 * @throws IOException on error
 */
@Idempotent
public HeartbeatResponse sendHeartbeat(DatanodeRegistration registration,
                                     StorageReport[] reports,
                                     long dnCacheCapacity,
                                     long dnCacheUsed,
                                     int xmitsInProgress,
                                     int xceiverCount,
                                     int failedVolumes,
                                     VolumeFailureSummary volumeFailureSummary)
    throws IOException;
 
Example 17
Source Project: hadoop-ozone   Source File: OzoneManagerSecurityProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Get a valid Delegation Token.
 *
 * @param renewer the designated renewer for the token
 * @return Token<OzoneDelegationTokenSelector>
 * @throws OMException
 */
@Idempotent
Token<OzoneTokenIdentifier> getDelegationToken(Text renewer)
    throws OMException;
 
Example 18
Source Project: hadoop   Source File: NamenodeProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Request name-node version and storage information.
 * 
 * @return {@link NamespaceInfo} identifying versions and storage information 
 *          of the name-node
 * @throws IOException
 */
@Idempotent
public NamespaceInfo versionRequest() throws IOException;
 
Example 19
Source Project: hadoop   Source File: NamenodeProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Closes the current edit log and opens a new one. The 
 * call fails if the file system is in SafeMode.
 * @throws IOException
 * @return a unique token to identify this transaction.
 */
@Idempotent
public CheckpointSignature rollEditLog() throws IOException;
 
Example 20
Source Project: hadoop   Source File: NamenodeProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * @return Whether the NameNode is in upgrade state (false) or not (true)
 */
@Idempotent
public boolean isUpgradeFinalized() throws IOException;
 
Example 21
Source Project: hadoop   Source File: QJournalProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Discard journal segments whose first TxId is greater than or equal to the
 * given txid.
 */
@Idempotent
public void discardSegments(String journalId, long startTxId)
    throws IOException;
 
Example 22
Source Project: hadoop   Source File: HAServiceProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Request service to transition to active state. No operation, if the
 * service is already in active state.
 * 
 * @throws ServiceFailedException
 *           if transition from standby to active fails.
 * @throws AccessControlException
 *           if access is denied.
 * @throws IOException
 *           if other errors happen
 */
@Idempotent
public void transitionToActive(StateChangeRequestInfo reqInfo)
                                 throws ServiceFailedException,
                                        AccessControlException,
                                        IOException;
 
Example 23
Source Project: hadoop   Source File: DatanodeProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Communicates the complete list of locally cached blocks to the NameNode.
 * 
 * This method is similar to
 * {@link #blockReport(DatanodeRegistration, String, StorageBlockReport[], BlockReportContext)},
 * which is used to communicated blocks stored on disk.
 *
 * @param            The datanode registration.
 * @param poolId     The block pool ID for the blocks.
 * @param blockIds   A list of block IDs.
 * @return           The DatanodeCommand.
 * @throws IOException
 */
@Idempotent
public DatanodeCommand cacheReport(DatanodeRegistration registration,
    String poolId, List<Long> blockIds) throws IOException;
 
Example 24
Source Project: hadoop   Source File: ApplicationClientProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Move an application to a new queue.
 * 
 * @param request the application ID and the target queue
 * @return an empty response
 * @throws YarnException
 * @throws IOException
 */
@Public
@Unstable
@Idempotent
public MoveApplicationAcrossQueuesResponse moveApplicationAcrossQueues(
    MoveApplicationAcrossQueuesRequest request) throws YarnException, IOException;
 
Example 25
Source Project: hadoop   Source File: ApplicationBaseProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * The interface used by clients to get a report of an Application from the
 * <code>ResourceManager</code> or <code>ApplicationHistoryServer</code>.
 * <p>
 * The client, via {@link GetApplicationReportRequest} provides the
 * {@link ApplicationId} of the application.
 * <p>
 * In secure mode,the <code>ResourceManager</code> or
 * <code>ApplicationHistoryServer</code> verifies access to the application,
 * queue etc. before accepting the request.
 * <p>
 * The <code>ResourceManager</code> or <code>ApplicationHistoryServer</code>
 * responds with a {@link GetApplicationReportResponse} which includes the
 * {@link ApplicationReport} for the application.
 * <p>
 * If the user does not have <code>VIEW_APP</code> access then the following
 * fields in the report will be set to stubbed values:
 * <ul>
 *   <li>host - set to "N/A"</li>
 *   <li>RPC port - set to -1</li>
 *   <li>client token - set to "N/A"</li>
 *   <li>diagnostics - set to "N/A"</li>
 *   <li>tracking URL - set to "N/A"</li>
 *   <li>original tracking URL - set to "N/A"</li>
 *   <li>resource usage report - all values are -1</li>
 * </ul>
 *
 * @param request
 *          request for an application report
 * @return application report
 * @throws YarnException
 * @throws IOException
 */
@Public
@Stable
@Idempotent
public GetApplicationReportResponse getApplicationReport(
    GetApplicationReportRequest request) throws YarnException, IOException;
 
Example 26
Source Project: hadoop   Source File: DatanodeProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/** 
 * Register Datanode.
 *
 * @see org.apache.hadoop.hdfs.server.namenode.FSNamesystem#registerDatanode(DatanodeRegistration)
 * @param registration datanode registration information
 * @return the given {@link org.apache.hadoop.hdfs.server.protocol.DatanodeRegistration} with
 *  updated registration information
 */
@Idempotent
public DatanodeRegistration registerDatanode(DatanodeRegistration registration
    ) throws IOException;
 
Example 27
Source Project: hadoop   Source File: ApplicationBaseProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <p>
 * The interface used by clients to get a report of all Application attempts
 * in the cluster from the <code>ResourceManager</code> or
 * <code>ApplicationHistoryServer</code>
 * </p>
 *
 * <p>
 * The <code>ResourceManager</code> or <code>ApplicationHistoryServer</code>
 * responds with a {@link GetApplicationAttemptsRequest} which includes the
 * {@link ApplicationAttemptReport} for all the applications attempts of a
 * specified application attempt.
 * </p>
 *
 * <p>
 * If the user does not have <code>VIEW_APP</code> access for an application
 * then the corresponding report will be filtered as described in
 * {@link #getApplicationAttemptReport(GetApplicationAttemptReportRequest)}.
 * </p>
 *
 * @param request
 *          request for reports on all application attempts of an application
 * @return reports on all application attempts of an application
 * @throws YarnException
 * @throws IOException
 */
@Public
@Unstable
@Idempotent
public GetApplicationAttemptsResponse getApplicationAttempts(
    GetApplicationAttemptsRequest request) throws YarnException, IOException;
 
Example 28
Source Project: hadoop   Source File: ApplicationBaseProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <p>
 * The interface used by clients to get a report of an Container from the
 * <code>ResourceManager</code> or <code>ApplicationHistoryServer</code>
 * </p>
 *
 * <p>
 * The client, via {@link GetContainerReportRequest} provides the
 * {@link ContainerId} of the container.
 * </p>
 *
 * <p>
 * In secure mode,the <code>ResourceManager</code> or
 * <code>ApplicationHistoryServer</code> verifies access to the method before
 * accepting the request.
 * </p>
 *
 * <p>
 * The <code>ResourceManager</code> or <code>ApplicationHistoryServer</code>
 * responds with a {@link GetContainerReportResponse} which includes the
 * {@link ContainerReport} for the container.
 * </p>
 *
 * @param request
 *          request for a container report
 * @return container report
 * @throws YarnException
 * @throws IOException
 */
@Public
@Unstable
@Idempotent
public GetContainerReportResponse getContainerReport(
    GetContainerReportRequest request) throws YarnException, IOException;
 
Example 29
Source Project: hadoop   Source File: ApplicationBaseProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <p>
 * The interface used by clients to get a report of Containers for an
 * application attempt from the <code>ResourceManager</code> or
 * <code>ApplicationHistoryServer</code>
 * </p>
 *
 * <p>
 * The client, via {@link GetContainersRequest} provides the
 * {@link ApplicationAttemptId} of the application attempt.
 * </p>
 *
 * <p>
 * In secure mode,the <code>ResourceManager</code> or
 * <code>ApplicationHistoryServer</code> verifies access to the method before
 * accepting the request.
 * </p>
 *
 * <p>
 * The <code>ResourceManager</code> or <code>ApplicationHistoryServer</code>
 * responds with a {@link GetContainersResponse} which includes a list of
 * {@link ContainerReport} for all the containers of a specific application
 * attempt.
 * </p>
 *
 * @param request
 *          request for a list of container reports of an application attempt.
 * @return reports on all containers of an application attempt
 * @throws YarnException
 * @throws IOException
 */
@Public
@Unstable
@Idempotent
public GetContainersResponse getContainers(GetContainersRequest request)
    throws YarnException, IOException;
 
Example 30
Source Project: hadoop   Source File: NamenodeProtocol.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Get the current block keys
 * 
 * @return ExportedBlockKeys containing current block keys
 * @throws IOException 
 */
@Idempotent
public ExportedBlockKeys getBlockKeys() throws IOException;