Using the DatasetClient client, the truncate operation normally fails. In some cases the truncation of the dataset works, but the API almost always throws an IOException with either a "Read timeout" or a "500 error". The DatasetClient is used in an application that is running outside of CDAP and the cluster. If I do the same truncate operation from either the CDAP UI or the REST API it is successful. Is there a way to increase the timeout? I have seen similar behavior with the ProgramClient waitForStatus API, it often throws an IOException due to a read timeout before the program it is monitoring completes.
DatasetClient dc = new DatasetClient(clientConfig);
DatasetId datasetId = NamespaceId.fromString("namespace:" + namespace).dataset(datasetTruncate);