Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILDING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Requirements:
* JDK 1.8+
* Maven 3.1 or later
* Findbugs 2.0.2 or later (if running findbugs)
* ProtocolBuffer 2.5.0
* ProtocolBuffer 3.19.4
* Internet connection for first build (to fetch all dependencies)
* Hadoop version should be 2.7.0 or higher.

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<pig.version>0.13.0</pig.version>
<jersey.version>1.19</jersey.version>
<slf4j.version>1.7.30</slf4j.version>
<protobuf.version>2.5.0</protobuf.version>
<protobuf.version>3.19.4</protobuf.version>
<roaringbitmap.version>0.7.45</roaringbitmap.version>
<protoc.path>${env.PROTOC_PATH}</protoc.path>
<scm.url>scm:git:https://gitbox.apache.org/repos/asf/tez.git</scm.url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.util.ConverterUtils;
import org.apache.tez.dag.history.HistoryEvent;
Expand Down Expand Up @@ -90,7 +91,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
AMLaunchedProto proto = inputStream.readMessage(AMLaunchedProto.PARSER, null);
AMLaunchedProto proto = inputStream.readMessage(AMLaunchedProto.parser(), ExtensionRegistry.newInstance());
Copy link
Contributor

@abstractdog abstractdog Mar 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. is this PARSER -> parser() change backward compatible?
  2. what is ExtensionRegistry.newInstance() about exactly?

in general, I want to avoid every direct change in the first place which makes tez unable to compile on 2.5

Copy link
Contributor Author

@mark-bathori mark-bathori Mar 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The PARSER field is deprecated in version 3 but replacing it with parser() is breaking backward compatibility so this needs to be reverted.
  2. Protobuf3 introduced a nullcheck on the extensionRegistry parameter so if it gets null value then it will throw a NullpointerException, that’s why I replaced it with ExtensionRegistry.newInstance() which is creating an empty instance (after checking this getEmptyRegistry() would be better since it is creating empty maps for the new instance)
    I checked the generated code both on Protobuf2 and Protobuf3 but it seems that extensionRegistry param is not used in our inputStream.readMessage use case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @mbathori-cloudera, I think now we can move on with PARSER (even if it's deprecated), as we haven't decided about a major tez release yet, so backward compatibility now looks more important to me

if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.util.ConverterUtils;
import org.apache.tez.dag.history.HistoryEvent;
Expand Down Expand Up @@ -85,7 +86,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
AMStartedProto proto = inputStream.readMessage(AMStartedProto.PARSER, null);
AMStartedProto proto = inputStream.readMessage(AMStartedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.util.ConverterUtils;
Expand Down Expand Up @@ -83,7 +84,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
ContainerLaunchedProto proto = inputStream.readMessage(ContainerLaunchedProto.PARSER, null);
ContainerLaunchedProto proto =
inputStream.readMessage(ContainerLaunchedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.util.ConverterUtils;
Expand Down Expand Up @@ -88,7 +89,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
ContainerStoppedProto proto = inputStream.readMessage(ContainerStoppedProto.PARSER, null);
ContainerStoppedProto proto =
inputStream.readMessage(ContainerStoppedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
import org.apache.tez.dag.history.SummaryEvent;
Expand Down Expand Up @@ -76,7 +77,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
DAGCommitStartedProto proto = inputStream.readMessage(DAGCommitStartedProto.PARSER, null);
DAGCommitStartedProto proto =
inputStream.readMessage(DAGCommitStartedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
import org.apache.tez.common.counters.TezCounters;
import org.apache.tez.dag.api.DagTypeConverters;
Expand Down Expand Up @@ -129,7 +130,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
DAGFinishedProto proto = inputStream.readMessage(DAGFinishedProto.PARSER, null);
DAGFinishedProto proto = inputStream.readMessage(DAGFinishedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
import org.apache.tez.dag.records.DAGIDAware;
Expand Down Expand Up @@ -91,7 +92,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
DAGInitializedProto proto = inputStream.readMessage(DAGInitializedProto.PARSER, null);
DAGInitializedProto proto = inputStream.readMessage(DAGInitializedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
import org.apache.tez.dag.history.SummaryEvent;
Expand Down Expand Up @@ -76,7 +77,7 @@ public DAGKillRequestProto toProto() {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
DAGKillRequestProto proto = inputStream.readMessage(DAGKillRequestProto.PARSER, null);
DAGKillRequestProto proto = inputStream.readMessage(DAGKillRequestProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.app.dag.DAGState;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
Expand Down Expand Up @@ -81,7 +82,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
DAGStartedProto proto = inputStream.readMessage(DAGStartedProto.PARSER, null);
DAGStartedProto proto = inputStream.readMessage(DAGStartedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.records.DAGIDAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -134,7 +135,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
DAGSubmittedProto proto = inputStream.readMessage(DAGSubmittedProto.PARSER, null);
DAGSubmittedProto proto = inputStream.readMessage(DAGSubmittedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.common.TezConverterUtils;
import org.apache.tez.common.counters.CounterGroup;
import org.apache.tez.common.counters.TezCounter;
Expand Down Expand Up @@ -235,7 +236,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
TaskAttemptFinishedProto proto = inputStream.readMessage(TaskAttemptFinishedProto.PARSER, null);
TaskAttemptFinishedProto proto =
inputStream.readMessage(TaskAttemptFinishedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.hadoop.yarn.api.records.ContainerId;
import org.apache.hadoop.yarn.api.records.NodeId;
import org.apache.hadoop.yarn.util.ConverterUtils;
Expand Down Expand Up @@ -98,7 +99,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
TaskAttemptStartedProto proto = inputStream.readMessage(TaskAttemptStartedProto.PARSER, null);
TaskAttemptStartedProto proto =
inputStream.readMessage(TaskAttemptStartedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.common.counters.CounterGroup;
import org.apache.tez.common.counters.TezCounter;
import org.apache.tez.dag.records.TaskIDAware;
Expand Down Expand Up @@ -116,7 +117,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
TaskFinishedProto proto = inputStream.readMessage(TaskFinishedProto.PARSER, null);
TaskFinishedProto proto = inputStream.readMessage(TaskFinishedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.api.oldrecords.TaskState;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
Expand Down Expand Up @@ -90,7 +91,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
TaskStartedProto proto = inputStream.readMessage(TaskStartedProto.PARSER, null);
TaskStartedProto proto = inputStream.readMessage(TaskStartedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
import org.apache.tez.dag.history.SummaryEvent;
Expand Down Expand Up @@ -80,7 +81,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
VertexCommitStartedProto proto = inputStream.readMessage(VertexCommitStartedProto.PARSER, null);
VertexCommitStartedProto proto =
inputStream.readMessage(VertexCommitStartedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.api.DagTypeConverters;
import org.apache.tez.dag.api.EdgeProperty;
import org.apache.tez.dag.api.VertexLocationHint;
Expand Down Expand Up @@ -162,7 +163,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
VertexConfigurationDoneProto proto = inputStream.readMessage(VertexConfigurationDoneProto.PARSER, null);
VertexConfigurationDoneProto proto =
inputStream.readMessage(VertexConfigurationDoneProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.app.dag.impl.ServicePluginInfo;
import org.apache.tez.dag.records.VertexIDAware;
import org.slf4j.Logger;
Expand Down Expand Up @@ -131,7 +132,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
VertexFinishedProto proto = inputStream.readMessage(VertexFinishedProto.PARSER, null);
VertexFinishedProto proto = inputStream.readMessage(VertexFinishedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
import org.apache.tez.dag.history.SummaryEvent;
Expand Down Expand Up @@ -101,7 +102,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
VertexGroupCommitFinishedProto proto = inputStream.readMessage(VertexGroupCommitFinishedProto.PARSER, null);
VertexGroupCommitFinishedProto proto =
inputStream.readMessage(VertexGroupCommitFinishedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
import org.apache.tez.dag.history.SummaryEvent;
Expand Down Expand Up @@ -101,7 +102,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
VertexGroupCommitStartedProto proto = inputStream.readMessage(VertexGroupCommitStartedProto.PARSER, null);
VertexGroupCommitStartedProto proto =
inputStream.readMessage(VertexGroupCommitStartedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.api.DagTypeConverters;
import org.apache.tez.dag.api.InputDescriptor;
import org.apache.tez.dag.api.InputInitializerDescriptor;
Expand Down Expand Up @@ -158,7 +159,8 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
VertexInitializedProto proto = inputStream.readMessage(VertexInitializedProto.PARSER, null);
VertexInitializedProto proto =
inputStream.readMessage(VertexInitializedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.CodedOutputStream;
import com.google.protobuf.ExtensionRegistry;
import org.apache.tez.dag.app.dag.VertexState;
import org.apache.tez.dag.history.HistoryEvent;
import org.apache.tez.dag.history.HistoryEventType;
Expand Down Expand Up @@ -81,7 +82,7 @@ public void toProtoStream(CodedOutputStream outputStream) throws IOException {

@Override
public void fromProtoStream(CodedInputStream inputStream) throws IOException {
VertexStartedProto proto = inputStream.readMessage(VertexStartedProto.PARSER, null);
VertexStartedProto proto = inputStream.readMessage(VertexStartedProto.parser(), ExtensionRegistry.newInstance());
if (proto == null) {
throw new IOException("No data found in stream");
}
Expand Down
Loading