IPWorks Cloud 2020 C++ Edition

Questions / Feedback?

DoCustomOp Method

Executes an arbitrary WebHDFS operation.

Syntax

ANSI (Cross Platform)
int DoCustomOp(const char* lpszHttpMethod, const char* lpszRequestPath, const char* lpszOp);

Unicode (Windows)
INT DoCustomOp(LPCWSTR lpszHttpMethod, LPCWSTR lpszRequestPath, LPCWSTR lpszOp);
- (void)doCustomOp:(NSString*)httpMethod :(NSString*)requestPath :(NSString*)op;
#define MID_HADOOPDFS_DOCUSTOMOP 6

IPWORKSCLOUD_EXTERNAL int IPWORKSCLOUD_CALL IPWorksCloud_HadoopDFS_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method can be used to execute any WebHDFS operation the class does not explicitly implement.

Valid values for HttpMethod are:

  • GET (default if empty)
  • POST
  • PUT
  • DELETE

RequestPath must either be a valid resource path, or empty string. Op must be a valid WebHDFS operation (refer to the Hadoop WebHDFS documentation for a full list of supported operations).

Usage

When this method is called, the class will do the following:

  1. Build a request URL using URL, RequestPath, Op, and the query parameters held by the QueryParam* properties.
  2. Send the request using the given HttpMethod, the request URL built in step 1, the headers held by OtherHeaders, and the currently-configured authentication (if any; refer to AuthMechanism for more information). The request is always sent with an empty body.
  3. Store the response headers in the ParsedHeader* properties, and the response body in the stream specified using SetDownloadStream, the specified LocalFile, or ResourceData (using the same logic as DownloadFile).

If the response body is JSON data, the XPath, XText, and other X* configuration settings can then be used to navigate and extract information from it.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 C++ Edition - Version 20.0 [Build 8265]