Skip to content

Commit e00d9b7

Browse files
author
asingh
committed
Rename isReused => isBackingBytesReused
1 parent d2ad939 commit e00d9b7

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

  • parquet-column/src/main/java/org/apache/parquet/io/api

parquet-column/src/main/java/org/apache/parquet/io/api/Binary.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
abstract public class Binary implements Comparable<Binary>, Serializable {
3535

36-
protected boolean isReused;
36+
protected boolean isBackingBytesReused;
3737

3838
// this isn't really something others should extend
3939
private Binary() { }
@@ -85,14 +85,14 @@ public boolean equals(Object obj) {
8585
public String toString() {
8686
return "Binary{" +
8787
length() +
88-
(isReused ? " reused": " constant") +
88+
(isBackingBytesReused ? " reused": " constant") +
8989
" bytes, " +
9090
Arrays.toString(getBytesUnsafe())
9191
+ "}";
9292
}
9393

9494
public Binary copy() {
95-
if (isReused) {
95+
if (isBackingBytesReused) {
9696
return Binary.fromConstantByteArray(getBytes());
9797
} else {
9898
return this;
@@ -103,20 +103,20 @@ public Binary copy() {
103103
* Signals if backing bytes are owned, and can be modified, by producer of the Binary
104104
* @return if backing bytes are held on by producer of the Binary
105105
*/
106-
public boolean isReused() {
107-
return isReused;
106+
public boolean isBackingBytesReused() {
107+
return isBackingBytesReused;
108108
}
109109

110110
private static class ByteArraySliceBackedBinary extends Binary {
111111
private final byte[] value;
112112
private final int offset;
113113
private final int length;
114114

115-
public ByteArraySliceBackedBinary(byte[] value, int offset, int length, boolean isReused) {
115+
public ByteArraySliceBackedBinary(byte[] value, int offset, int length, boolean isBackingBytesReused) {
116116
this.value = value;
117117
this.offset = offset;
118118
this.length = length;
119-
this.isReused = isReused;
119+
this.isBackingBytesReused = isBackingBytesReused;
120120
}
121121

122122
@Override
@@ -151,7 +151,7 @@ public byte[] getBytesUnsafe() {
151151

152152
@Override
153153
public Binary slice(int start, int length) {
154-
if (isReused) {
154+
if (isBackingBytesReused) {
155155
return Binary.fromReusedByteArray(value, offset + start, length);
156156
} else {
157157
return Binary.fromConstantByteArray(value, offset + start, length);
@@ -226,9 +226,9 @@ public static Binary fromConstantByteArray(final byte[] value, final int offset,
226226
private static class ByteArrayBackedBinary extends Binary {
227227
private final byte[] value;
228228

229-
public ByteArrayBackedBinary(byte[] value, boolean isReused) {
229+
public ByteArrayBackedBinary(byte[] value, boolean isBackingBytesReused) {
230230
this.value = value;
231-
this.isReused = isReused;
231+
this.isBackingBytesReused = isBackingBytesReused;
232232
}
233233

234234
@Override
@@ -258,7 +258,7 @@ public byte[] getBytesUnsafe() {
258258

259259
@Override
260260
public Binary slice(int start, int length) {
261-
if (isReused) {
261+
if (isBackingBytesReused) {
262262
return Binary.fromReusedByteArray(value, start, length);
263263
} else {
264264
return Binary.fromConstantByteArray(value, start, length);
@@ -314,9 +314,9 @@ private static class ByteBufferBackedBinary extends Binary {
314314
private transient ByteBuffer value;
315315
private transient byte[] cachedBytes;
316316

317-
public ByteBufferBackedBinary(ByteBuffer value, boolean isReused) {
317+
public ByteBufferBackedBinary(ByteBuffer value, boolean isBackingBytesReused) {
318318
this.value = value;
319-
this.isReused = isReused;
319+
this.isBackingBytesReused = isBackingBytesReused;
320320
}
321321

322322
@Override
@@ -341,7 +341,7 @@ public byte[] getBytes() {
341341

342342
value.mark();
343343
value.get(bytes).reset();
344-
if (!isReused) { // backing buffer might change
344+
if (!isBackingBytesReused) { // backing buffer might change
345345
cachedBytes = bytes;
346346
}
347347
return bytes;

0 commit comments

Comments
 (0)