Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
**/target
**/dependency-reduced-pom.xml
hbase-shaded-protobuf/src/main/
hbase-shaded-protobuf/src/main/java
hbase-shaded-protobuf/src/main/resources
.project
.settings
.classpath
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ rather than to a dir under target because the jar plugin wants src here (its
hard to convince it otherwise). We also apply some patches. Current set are:

```
HBASE-15789_V3.patch
HBASE-15789_V4.patch
Copy link
Contributor

@stoty stoty May 16, 2025

Choose a reason for hiding this comment

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

nit: not sure versioning this patch is useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

HBASE-17087.patch
HBASE-17239.patch
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ index 000000000..320977290
+ }
+}
diff --git a/src/main/java/com/google/protobuf/ByteString.java b/src/main/java/com/google/protobuf/ByteString.java
index 7b2455f12..f906a4774 100644
index 558d5a6ab..28795acc2 100644
--- a/src/main/java/com/google/protobuf/ByteString.java
+++ b/src/main/java/com/google/protobuf/ByteString.java
@@ -430,6 +430,13 @@ public abstract class ByteString implements Iterable<Byte>, Serializable {
@@ -429,6 +429,13 @@ public abstract class ByteString implements Iterable<Byte>, Serializable {
return new NioByteString(buffer);
}

Expand All @@ -383,13 +383,13 @@ index 7b2455f12..f906a4774 100644
-
- private LeafByteString() {}
}

/**
diff --git a/src/main/java/com/google/protobuf/CodedInputStream.java b/src/main/java/com/google/protobuf/CodedInputStream.java
index 81da41778..80fd9153c 100644
index fbdabf225..cd6f80779 100644
--- a/src/main/java/com/google/protobuf/CodedInputStream.java
+++ b/src/main/java/com/google/protobuf/CodedInputStream.java
@@ -178,6 +178,15 @@ public abstract class CodedInputStream {
@@ -191,6 +191,15 @@ public abstract class CodedInputStream {
}
}

Expand All @@ -404,8 +404,8 @@ index 81da41778..80fd9153c 100644
+
/** Disable construction/inheritance outside of this class. */
private CodedInputStream() {}
@@ -3970,4 +3979,652 @@ public abstract class CodedInputStream {

@@ -3943,4 +3952,652 @@ public abstract class CodedInputStream {
}
}
}
Expand Down Expand Up @@ -643,25 +643,25 @@ index 81da41778..80fd9153c 100644
+ @Override
+ public void readGroup(int fieldNumber, MessageLite.Builder builder,
+ ExtensionRegistryLite extensionRegistry) throws IOException {
+ if (recursionDepth >= recursionLimit) {
+ if (messageDepth + groupDepth >= recursionLimit) {
+ throw InvalidProtocolBufferException.recursionLimitExceeded();
+ }
+ ++recursionDepth;
+ ++groupDepth;
+ builder.mergeFrom(this, extensionRegistry);
+ checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP));
+ --recursionDepth;
+ --groupDepth;
+ }
+
+ @Override
+ public <T extends MessageLite> T readGroup(int fieldNumber, Parser<T> parser,
+ ExtensionRegistryLite extensionRegistry) throws IOException {
+ if (recursionDepth >= recursionLimit) {
+ if (messageDepth + groupDepth >= recursionLimit) {
+ throw InvalidProtocolBufferException.recursionLimitExceeded();
+ }
+ ++recursionDepth;
+ ++groupDepth;
+ T result = parser.parsePartialFrom(this, extensionRegistry);
+ checkLastTagWas(WireFormat.makeTag(fieldNumber, WireFormat.WIRETYPE_END_GROUP));
+ --recursionDepth;
+ --groupDepth;
+ return result;
+ }
+
Expand All @@ -675,29 +675,29 @@ index 81da41778..80fd9153c 100644
+ public void readMessage(MessageLite.Builder builder, ExtensionRegistryLite extensionRegistry)
+ throws IOException {
+ final int length = readRawVarint32();
+ if (recursionDepth >= recursionLimit) {
+ if (messageDepth + groupDepth >= recursionLimit) {
+ throw InvalidProtocolBufferException.recursionLimitExceeded();
+ }
+ final int oldLimit = pushLimit(length);
+ ++recursionDepth;
+ ++messageDepth;
+ builder.mergeFrom(this, extensionRegistry);
+ checkLastTagWas(0);
+ --recursionDepth;
+ --messageDepth;
+ popLimit(oldLimit);
+ }
+
+ @Override
+ public <T extends MessageLite> T readMessage(Parser<T> parser,
+ ExtensionRegistryLite extensionRegistry) throws IOException {
+ int length = readRawVarint32();
+ if (recursionDepth >= recursionLimit) {
+ if (messageDepth + groupDepth >= recursionLimit) {
+ throw InvalidProtocolBufferException.recursionLimitExceeded();
+ }
+ final int oldLimit = pushLimit(length);
+ ++recursionDepth;
+ ++messageDepth;
+ T result = parser.parsePartialFrom(this, extensionRegistry);
+ checkLastTagWas(0);
+ --recursionDepth;
+ --messageDepth;
+ popLimit(oldLimit);
+ return result;
+ }
Expand Down Expand Up @@ -1065,7 +1065,7 @@ index d52006754..92ed1f1f7 100644
@@ -196,6 +196,16 @@ final class Utf8 {
}
}

+ private static int incompleteStateFor(ByteInput bytes, int index, int limit) {
+ int byte1 = bytes.read(index - 1);
+ switch (limit - index) {
Expand All @@ -1082,7 +1082,7 @@ index d52006754..92ed1f1f7 100644
@@ -318,6 +328,24 @@ final class Utf8 {
return processor.decodeUtf8(bytes, index, size);
}

+ /**
+ * Determines if the given {@link ByteInput} is a valid UTF-8 string.
+ *
Expand Down
10 changes: 5 additions & 5 deletions hbase-shaded-protobuf/src/main/patches/HBASE-17239.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
diff --git a/src/main/java/com/google/protobuf/CodedInputStream.java b/src/main/java/com/google/protobuf/CodedInputStream.java
index 80fd9153c..11de874dd 100644
index cd6f80779..3c6d8e878 100644
--- a/src/main/java/com/google/protobuf/CodedInputStream.java
+++ b/src/main/java/com/google/protobuf/CodedInputStream.java
@@ -179,11 +179,7 @@ public abstract class CodedInputStream {
@@ -192,11 +192,7 @@ public abstract class CodedInputStream {
}

/** Create a new CodedInputStream wrapping the given {@link ByteInput}. */
- public static CodedInputStream newInstance(ByteInput buf, boolean bufferIsImmutable) {
- return new ByteInputDecoder(buf, bufferIsImmutable);
Expand All @@ -14,15 +14,15 @@ index 80fd9153c..11de874dd 100644
+ static CodedInputStream newInstance(ByteInput buf, int off, int len, boolean bufferIsImmutable) {
return new ByteInputDecoder(buf, off, len, bufferIsImmutable);
}

diff --git a/src/main/java/com/google/protobuf/UnsafeByteOperations.java b/src/main/java/com/google/protobuf/UnsafeByteOperations.java
index 15c1da969..54d2f975a 100644
--- a/src/main/java/com/google/protobuf/UnsafeByteOperations.java
+++ b/src/main/java/com/google/protobuf/UnsafeByteOperations.java
@@ -74,6 +74,17 @@ public final class UnsafeByteOperations {
return ByteString.wrap(buffer);
}

+ /**
+ * An unsafe operation that returns a {@link ByteString} that is backed by the provided buffer.
+ * @param buffer the ByteInput buffer to be wrapped
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<maven.min.version>3.3.3</maven.min.version>
<os.maven.version>1.7.1</os.maven.version>
<rename.offset>org.apache.hbase.thirdparty</rename.offset>
<protobuf.version>4.29.2</protobuf.version>
<protobuf.version>4.30.2</protobuf.version>
<netty.version>4.1.121.Final</netty.version>
<netty.tcnative.version>2.0.71.Final</netty.tcnative.version>
<guava.version>33.4.8-jre</guava.version>
Expand Down