-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KAFKA-16448: Update ErrorHandlerContext
Co-authored-by: Dabz <[email protected]> Co-authored-by: sebastienviale <[email protected]>
- Loading branch information
1 parent
ce4fbb2
commit 2acb03a
Showing
2 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
streams/src/main/java/org/apache/kafka/streams/errors/ErrorHandlerContextImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.kafka.streams.errors; | ||
|
||
import org.apache.kafka.common.header.Headers; | ||
import org.apache.kafka.streams.processor.TaskId; | ||
|
||
public class ErrorHandlerContextImpl implements ErrorHandlerContext { | ||
private final String topic; | ||
private final int partition; | ||
private final long offset; | ||
private final Headers headers; | ||
private final byte[] sourceRawKey; | ||
private final byte[] sourceRawValue; | ||
private final String processorNodeId; | ||
private final TaskId taskId; | ||
|
||
public ErrorHandlerContextImpl(final String topic, | ||
final int partition, | ||
final long offset, | ||
final Headers headers, | ||
final byte[] sourceRawKey, | ||
final byte[] sourceRawValue, | ||
final String processorNodeId, | ||
final TaskId taskId) { | ||
this.topic = topic; | ||
this.partition = partition; | ||
this.offset = offset; | ||
this.headers = headers; | ||
this.sourceRawKey = sourceRawKey; | ||
this.sourceRawValue = sourceRawValue; | ||
this.processorNodeId = processorNodeId; | ||
this.taskId = taskId; | ||
} | ||
|
||
|
||
@Override | ||
public String topic() { | ||
return this.topic; | ||
} | ||
|
||
@Override | ||
public int partition() { | ||
return this.partition; | ||
} | ||
|
||
@Override | ||
public long offset() { | ||
return this.offset; | ||
} | ||
|
||
@Override | ||
public Headers headers() { | ||
return this.headers; | ||
} | ||
|
||
@Override | ||
public byte[] sourceRawKey() { | ||
return this.sourceRawKey; | ||
} | ||
|
||
@Override | ||
public byte[] sourceRawValue() { | ||
return this.sourceRawValue; | ||
} | ||
|
||
@Override | ||
public String processorNodeId() { | ||
return this.processorNodeId; | ||
} | ||
|
||
@Override | ||
public TaskId taskId() { | ||
return this.taskId; | ||
} | ||
} |