Optimize TopicsImpl fix made in
align with recent refactoring
@@ -32,9 +32,6 @@ import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.ws.rs.client.Entity;
@@ -520,16 +517,7 @@ public class TopicsImpl extends BaseResource implements Topics {
@Override
public Map<Integer, MessageId> terminatePartitionedTopic(String topic) throws PulsarAdminException {
- try {
- return terminatePartitionedTopicAsync(topic).get(this.readTimeoutMs, TimeUnit.MILLISECONDS);
- } catch (ExecutionException e) {
- throw (PulsarAdminException) e.getCause();
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw new PulsarAdminException(e);
- } catch (TimeoutException e) {
- throw new PulsarAdminException.TimeoutException(e);
- }
+ return sync(() -> terminatePartitionedTopicAsync(topic));
}
@Override
