@Override public void storePayload(StoreRequest request) throws TopicNotFoundException, IOException { try { TopicMetadata metadata = topicCache.get(request.getTopicId()); payloadTableWriterCache.get(request.getTopicId()).persist(request, metadata); } catch (ExecutionException e) { Throwable cause = Objects.firstNonNull(e.getCause(), e); Throwables.propagateIfPossible(cause, TopicNotFoundException.class, IOException.class); throw Throwables.propagate(e); } }
@Override public void storePayload(StoreRequest request) throws TopicNotFoundException, IOException { try { TopicMetadata metadata = topicCache.get(request.getTopicId()); payloadTableWriterCache.get(request.getTopicId()).persist(request, metadata); } catch (ExecutionException e) { Throwable cause = Objects.firstNonNull(e.getCause(), e); Throwables.propagateIfPossible(cause, TopicNotFoundException.class, IOException.class); throw Throwables.propagate(e); } }
@Nullable @Override public RollbackDetail publish(StoreRequest request) throws TopicNotFoundException, IOException { try { TopicMetadata metadata = topicCache.get(request.getTopicId()); if (request.isTransactional()) { ensureValidTxLifetime(request.getTransactionWritePointer()); } return messageTableWriterCache.get(request.getTopicId()).persist(request, metadata); } catch (ExecutionException e) { Throwable cause = Objects.firstNonNull(e.getCause(), e); Throwables.propagateIfPossible(cause, TopicNotFoundException.class, IOException.class); throw Throwables.propagate(e); } }
@Nullable @Override public RollbackDetail publish(StoreRequest request) throws TopicNotFoundException, IOException { try { TopicMetadata metadata = topicCache.get(request.getTopicId()); if (request.isTransactional()) { ensureValidTxLifetime(request.getTransactionWritePointer()); } return messageTableWriterCache.get(request.getTopicId()).persist(request, metadata); } catch (ExecutionException e) { Throwable cause = Objects.firstNonNull(e.getCause(), e); Throwables.propagateIfPossible(cause, TopicNotFoundException.class, IOException.class); throw Throwables.propagate(e); } }
PendingStoreRequest(StoreRequest originalRequest, TopicMetadata topicMetadata) { super(originalRequest.getTopicId(), originalRequest.isTransactional(), originalRequest.getTransactionWritePointer()); this.originalRequest = originalRequest; this.metadata = topicMetadata; }
PendingStoreRequest(StoreRequest originalRequest, TopicMetadata topicMetadata) { super(originalRequest.getTopicId(), originalRequest.isTransactional(), originalRequest.getTransactionWritePointer()); this.originalRequest = originalRequest; this.metadata = topicMetadata; }
metricsCollector.increment("persist.failure", 1L); Throwables.propagateIfInstanceOf(pendingStoreRequest.getFailureCause(), IOException.class); throw new IOException("Unable to write message to " + storeRequest.getTopicId(), pendingStoreRequest.getFailureCause());
metricsCollector.increment("persist.failure", 1L); Throwables.propagateIfInstanceOf(pendingStoreRequest.getFailureCause(), IOException.class); throw new IOException("Unable to write message to " + storeRequest.getTopicId(), pendingStoreRequest.getFailureCause());
TopicId topicId = request.getTopicId(); HttpRequest httpRequest = remoteClient.requestBuilder(HttpMethod.POST, createTopicPath(topicId) + "/" + writeType) .addHeader(HttpHeaders.CONTENT_TYPE, "avro/binary")
TopicId topicId = request.getTopicId(); HttpRequest httpRequest = remoteClient.requestBuilder(HttpMethod.POST, createTopicPath(topicId) + "/" + writeType) .addHeader(HttpHeaders.CONTENT_TYPE, "avro/binary")