This is an automated email from the ASF dual-hosted git repository.
apolovtsev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/main by this push:
new 0552fe35ce IGNITE-20401 Cleanup in IgniteUtils (#2591)
0552fe35ce is described below
commit 0552fe35ceef3361eb28d30c4a56b1e6d34581a3
Author: Alexander Polovtcev <[email protected]>
AuthorDate: Fri Sep 15 11:40:10 2023 +0300
IGNITE-20401 Cleanup in IgniteUtils (#2591)
* Fix TODOs
* Add some usages of `copyStateTo`
---
.../internal/causality/BaseVersionedValue.java | 9 +-
.../ignite/internal/future/OrderingFuture.java | 18 ++-
.../internal/streamer/StreamerSubscriber.java | 10 +-
.../ignite/internal/util/HexStringUtils.java | 146 +++++++++++++++++++++
.../apache/ignite/internal/util/IgniteUtils.java | 131 +-----------------
.../ignite/internal/util/OffheapReadWriteLock.java | 4 +-
.../ignite/internal/util/HexStringUtilsTest.java | 50 +++++++
.../ignite/internal/util/IgniteUtilsTest.java | 27 ----
.../tree/AbstractBplusTreePageMemoryTest.java | 2 +-
.../pagememory/datastructure/DataStructure.java | 4 +-
.../internal/pagememory/freelist/PagesList.java | 3 +-
.../pagememory/inmemory/VolatilePageMemory.java | 3 +-
.../pagememory/mem/unsafe/UnsafeChunk.java | 4 +-
.../internal/pagememory/persistence/PagePool.java | 2 +-
.../persistence/PersistentPageMemory.java | 4 +-
.../pagememory/persistence/ReplaceCandidate.java | 2 +-
.../checkpoint/CheckpointPagesWriter.java | 2 +-
.../persistence/store/AbstractFilePageStoreIo.java | 6 +-
.../store/DeltaFilePageStoreIoHeader.java | 2 +-
.../persistence/store/FilePageStoreHeader.java | 2 +-
.../ignite/internal/pagememory/tree/BplusTree.java | 2 +-
.../internal/pagememory/util/PageIdUtils.java | 4 +-
.../internal/pagememory/util/PageIdUtilsTest.java | 6 +-
.../datatypes/varbinary/ItVarBinaryIndexTest.java | 6 +-
.../org/apache/ignite/internal/sqllogic/Query.java | 4 +-
.../configuration/ValueSerializationHelper.java | 10 +-
.../storage/pagememory/index/meta/IndexMeta.java | 4 +-
27 files changed, 252 insertions(+), 215 deletions(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/causality/BaseVersionedValue.java
b/modules/core/src/main/java/org/apache/ignite/internal/causality/BaseVersionedValue.java
index f20a1b2664..ce77479b68 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/causality/BaseVersionedValue.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/causality/BaseVersionedValue.java
@@ -18,6 +18,7 @@
package org.apache.ignite.internal.causality;
import static java.util.concurrent.CompletableFuture.completedFuture;
+import static org.apache.ignite.internal.util.IgniteUtils.copyStateTo;
import static org.apache.ignite.lang.IgniteStringFormatter.format;
import java.util.ArrayList;
@@ -311,13 +312,7 @@ class BaseVersionedValue<T> implements VersionedValue<T> {
assert from.isDone();
assert !to.isDone();
- from.whenComplete((v, t) -> {
- if (t != null) {
- to.completeExceptionally(t);
- } else {
- to.complete(v);
- }
- });
+ from.whenComplete(copyStateTo(to));
}
@Override
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java
b/modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java
index 40b7821f07..046f0391a2 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/future/OrderingFuture.java
@@ -17,6 +17,8 @@
package org.apache.ignite.internal.future;
+import static org.apache.ignite.internal.util.IgniteUtils.copyStateTo;
+
import java.lang.invoke.MethodHandles;
import java.lang.invoke.VarHandle;
import java.util.ArrayDeque;
@@ -457,19 +459,11 @@ public class OrderingFuture<T> {
public CompletableFuture<T> toCompletableFuture() {
CompletableFuture<T> completableFuture = new CompletableFuture<>();
- this.whenComplete((res, ex) ->
completeCompletableFuture(completableFuture, res, ex));
+ this.whenComplete(copyStateTo(completableFuture));
return completableFuture;
}
- private static <T> void completeCompletableFuture(CompletableFuture<T>
future, T result, Throwable ex) {
- if (ex != null) {
- future.completeExceptionally(ex);
- } else {
- future.complete(result);
- }
- }
-
/**
* Dependent action that gets notified when this future is completed.
*
@@ -547,7 +541,11 @@ public class OrderingFuture<T> {
@Override
public void accept(U mapRes, Throwable mapEx) {
- completeCompletableFuture(resultFuture, mapRes, mapEx);
+ if (mapEx != null) {
+ resultFuture.completeExceptionally(mapEx);
+ } else {
+ resultFuture.complete(mapRes);
+ }
}
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/streamer/StreamerSubscriber.java
b/modules/core/src/main/java/org/apache/ignite/internal/streamer/StreamerSubscriber.java
index b256915671..bec24cde20 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/streamer/StreamerSubscriber.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/streamer/StreamerSubscriber.java
@@ -17,6 +17,8 @@
package org.apache.ignite.internal.streamer;
+import static org.apache.ignite.internal.util.IgniteUtils.copyStateTo;
+
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
@@ -223,13 +225,7 @@ public class StreamerSubscriber<T, P> implements
Subscriber<T> {
var futs = pendingRequests.values().toArray(new
CompletableFuture[0]);
- CompletableFuture.allOf(futs).whenComplete((res, err) -> {
- if (err != null) {
- completionFut.completeExceptionally(err);
- } else {
- completionFut.complete(null);
- }
- });
+
CompletableFuture.allOf(futs).whenComplete(copyStateTo(completionFut));
} else {
completionFut.completeExceptionally(throwable);
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/util/HexStringUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/HexStringUtils.java
new file mode 100644
index 0000000000..70a172e99e
--- /dev/null
+++
b/modules/core/src/main/java/org/apache/ignite/internal/util/HexStringUtils.java
@@ -0,0 +1,146 @@
+/*
+ * 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.ignite.internal.util;
+
+import java.nio.ByteBuffer;
+import org.apache.ignite.lang.IgniteStringBuilder;
+
+/**
+ * Utility methods for converting various types to HEX string representation.
+ */
+public class HexStringUtils {
+ /** Byte bit-mask. */
+ private static final int MASK = 0xf;
+
+ /**
+ * Converts byte array to hex string.
+ *
+ * @param arr Array of bytes.
+ * @return Hex string.
+ */
+ public static String toHexString(byte[] arr) {
+ return toHexString(arr, Integer.MAX_VALUE);
+ }
+
+ /**
+ * Converts byte array to hex string.
+ *
+ * @param arr Array of bytes.
+ * @param maxLen Maximum length of result string. Rounds down to a power
of two.
+ * @return Hex string.
+ */
+ public static String toHexString(byte[] arr, int maxLen) {
+ assert maxLen >= 0 : "maxLem must be not negative.";
+
+ int capacity = Math.min(arr.length << 1, maxLen);
+
+ int lim = capacity >> 1;
+
+ StringBuilder sb = new StringBuilder(capacity);
+
+ for (int i = 0; i < lim; i++) {
+ addByteAsHex(sb, arr[i]);
+ }
+
+ return sb.toString().toUpperCase();
+ }
+
+ /**
+ * Returns hex representation of memory region.
+ *
+ * @param addr Pointer in memory.
+ * @param len How much byte to read.
+ */
+ public static String toHexString(long addr, int len) {
+ StringBuilder sb = new StringBuilder(len * 2);
+
+ for (int i = 0; i < len; i++) {
+ // Can not use getLong because on little-endian it produces wrong
result.
+ addByteAsHex(sb, GridUnsafe.getByte(addr + i));
+ }
+
+ return sb.toString();
+ }
+
+ /**
+ * Returns hex representation of memory region.
+ *
+ * @param buf Buffer which content should be converted to string.
+ */
+ public static String toHexString(ByteBuffer buf) {
+ StringBuilder sb = new StringBuilder(buf.capacity() * 2);
+
+ for (int i = buf.position(); i < buf.limit(); i++) {
+ // Can not use getLong because on little-endian it produces wrong
result.
+ addByteAsHex(sb, buf.get(i));
+ }
+
+ return sb.toString();
+ }
+
+ /**
+ * Returns byte array represented by given hex string.
+ *
+ * @param s String containing a hex representation of bytes.
+ * @return A byte array.
+ */
+ public static byte[] fromHexString(String s) {
+ var len = s.length();
+
+ assert (len & 1) == 0 : "length should be even";
+
+ var data = new byte[len / 2];
+
+ for (int i = 0; i < len; i += 2) {
+ data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
+ + Character.digit(s.charAt(i + 1), 16));
+ }
+
+ return data;
+ }
+
+ /**
+ * Appends {@code byte} in hexadecimal format.
+ *
+ * @param sb String builder.
+ * @param b Byte to add in hexadecimal format.
+ */
+ private static void addByteAsHex(StringBuilder sb, byte b) {
+ sb.append(Integer.toHexString(MASK & b >>>
4)).append(Integer.toHexString(MASK & b));
+ }
+
+ /**
+ * Returns a hex string representation of the given long value.
+ *
+ * @param val Value to convert to string.
+ * @return Hex string.
+ */
+ public static String hexLong(long val) {
+ return new IgniteStringBuilder(16).appendHex(val).toString();
+ }
+
+ /**
+ * Returns a hex string representation of the given integer value.
+ *
+ * @param val Value to convert to string.
+ * @return Hex string.
+ */
+ public static String hexInt(int val) {
+ return new IgniteStringBuilder(8).appendHex(val).toString();
+ }
+}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 8a6f6167b4..72e9fba7d7 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -70,7 +70,6 @@ import org.apache.ignite.internal.logger.IgniteLogger;
import org.apache.ignite.internal.manager.IgniteComponent;
import org.apache.ignite.internal.util.worker.IgniteWorker;
import org.apache.ignite.lang.IgniteInternalException;
-import org.apache.ignite.lang.IgniteStringBuilder;
import org.apache.ignite.lang.IgniteStringFormatter;
import org.apache.ignite.lang.NodeStoppingException;
import org.jetbrains.annotations.Nullable;
@@ -79,8 +78,6 @@ import org.jetbrains.annotations.Nullable;
* Collection of utility methods used throughout the system.
*/
public class IgniteUtils {
- /** Byte bit-mask. */
- private static final int MASK = 0xf;
/** The moment will be used as a start monotonic time. */
private static final long BEGINNING_OF_TIME = System.nanoTime();
@@ -253,125 +250,6 @@ public class IgniteUtils {
return hash(val);
}
- /**
- * Converts byte array to hex string.
- *
- * @param arr Array of bytes.
- * @return Hex string.
- */
- public static String toHexString(byte[] arr) {
- return toHexString(arr, Integer.MAX_VALUE);
- }
-
- /**
- * Converts byte array to hex string.
- *
- * @param arr Array of bytes.
- * @param maxLen Maximum length of result string. Rounds down to a power
of two.
- * @return Hex string.
- */
- public static String toHexString(byte[] arr, int maxLen) {
- assert maxLen >= 0 : "maxLem must be not negative.";
-
- int capacity = Math.min(arr.length << 1, maxLen);
-
- int lim = capacity >> 1;
-
- StringBuilder sb = new StringBuilder(capacity);
-
- for (int i = 0; i < lim; i++) {
- addByteAsHex(sb, arr[i]);
- }
-
- return sb.toString().toUpperCase();
- }
-
- /**
- * Returns hex representation of memory region.
- *
- * @param addr Pointer in memory.
- * @param len How much byte to read.
- */
- public static String toHexString(long addr, int len) {
- StringBuilder sb = new StringBuilder(len * 2);
-
- for (int i = 0; i < len; i++) {
- // Can not use getLong because on little-endian it produces wrong
result.
- addByteAsHex(sb, GridUnsafe.getByte(addr + i));
- }
-
- return sb.toString();
- }
-
- /**
- * Returns hex representation of memory region.
- *
- * @param buf Buffer which content should be converted to string.
- */
- public static String toHexString(ByteBuffer buf) {
- StringBuilder sb = new StringBuilder(buf.capacity() * 2);
-
- for (int i = buf.position(); i < buf.limit(); i++) {
- // Can not use getLong because on little-endian it produces wrong
result.
- addByteAsHex(sb, buf.get(i));
- }
-
- return sb.toString();
- }
-
- /**
- * Returns byte array represented by given hex string.
- *
- * @param s String containing a hex representation of bytes.
- * @return A byte array.
- */
- public static byte[] fromHexString(String s) {
- var len = s.length();
-
- assert (len & 1) == 0 : "length should be even";
-
- var data = new byte[len / 2];
-
- for (int i = 0; i < len; i += 2) {
- data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4)
- + Character.digit(s.charAt(i + 1), 16));
- }
-
- return data;
- }
-
- /**
- * Appends {@code byte} in hexadecimal format.
- *
- * @param sb String builder.
- * @param b Byte to add in hexadecimal format.
- */
- private static void addByteAsHex(StringBuilder sb, byte b) {
- sb.append(Integer.toHexString(MASK & b >>>
4)).append(Integer.toHexString(MASK & b));
- }
-
- /**
- * Returns a hex string representation of the given long value.
- *
- * @param val Value to convert to string.
- * @return Hex string.
- */
- //TODO IGNITE-16350 Consider renaming or moving into other class.
- public static String hexLong(long val) {
- return new IgniteStringBuilder(16).appendHex(val).toString();
- }
-
- /**
- * Returns a hex string representation of the given integer value.
- *
- * @param val Value to convert to string.
- * @return Hex string.
- */
- //TODO IGNITE-16350 Consider renaming or moving into other class.
- public static String hexInt(int val) {
- return new IgniteStringBuilder(8).appendHex(val).toString();
- }
-
/**
* Returns size in human-readable format.
*
@@ -468,7 +346,7 @@ public class IgniteUtils {
public static Class<?> forName(
String clsName,
@Nullable ClassLoader ldr,
- Predicate<String> clsFilter
+ @Nullable Predicate<String> clsFilter
) throws ClassNotFoundException {
assert clsName != null;
@@ -732,6 +610,7 @@ public class IgniteUtils {
* @param msg Message to print with the stack.
* @deprecated Calls to this method should never be committed to master.
*/
+ @Deprecated
public static void dumpStack(IgniteLogger log, String msg, Object...
params) {
String reason = "Dumping stack";
@@ -766,7 +645,7 @@ public class IgniteUtils {
try {
success = Files.move(sourcePath, targetPath,
StandardCopyOption.ATOMIC_MOVE);
- } catch (final IOException e) {
+ } catch (IOException e) {
// If it falls here that can mean many things. Either that the
atomic move is not supported,
// or something wrong happened. Anyway, let's try to be
over-diagnosing
if (log != null) {
@@ -783,7 +662,7 @@ public class IgniteUtils {
try {
success = Files.move(sourcePath, targetPath,
StandardCopyOption.REPLACE_EXISTING);
- } catch (final IOException e1) {
+ } catch (IOException e1) {
e1.addSuppressed(e);
if (log != null) {
@@ -795,7 +674,7 @@ public class IgniteUtils {
try {
Files.deleteIfExists(sourcePath);
- } catch (final IOException e2) {
+ } catch (IOException e2) {
e2.addSuppressed(e1);
if (log != null) {
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/util/OffheapReadWriteLock.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/OffheapReadWriteLock.java
index 8042496bc1..54e2030175 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/util/OffheapReadWriteLock.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/util/OffheapReadWriteLock.java
@@ -162,7 +162,7 @@ public class OffheapReadWriteLock {
if (lockCount(state) <= 0) {
throw new IllegalMonitorStateException("Attempted to release a
read lock while not holding it "
- + "[lock=" + IgniteUtils.hexLong(lock) + ", state=" +
IgniteUtils.hexLong(state) + ']');
+ + "[lock=" + HexStringUtils.hexLong(lock) + ", state="
+ HexStringUtils.hexLong(state) + ']');
}
long updated = updateState(state, -1, 0, 0);
@@ -281,7 +281,7 @@ public class OffheapReadWriteLock {
if (lockCount(state) != -1) {
throw new IllegalMonitorStateException("Attempted to release
write lock while not holding it "
- + "[lock=" + IgniteUtils.hexLong(lock) + ", state=" +
IgniteUtils.hexLong(state) + ']');
+ + "[lock=" + HexStringUtils.hexLong(lock) + ", state="
+ HexStringUtils.hexLong(state) + ']');
}
updated = releaseWithTag(state, tag);
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/util/HexStringUtilsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/HexStringUtilsTest.java
new file mode 100644
index 0000000000..bce2dbece9
--- /dev/null
+++
b/modules/core/src/test/java/org/apache/ignite/internal/util/HexStringUtilsTest.java
@@ -0,0 +1,50 @@
+/*
+ * 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.ignite.internal.util;
+
+import static org.apache.ignite.internal.util.HexStringUtils.toHexString;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.nio.ByteBuffer;
+import org.junit.jupiter.api.Test;
+
+class HexStringUtilsTest {
+ @Test
+ void testToHexStringByteBuffer() {
+ ByteBuffer buffer = ByteBuffer.allocate(8);
+
+ assertEquals("00000000ffffaaaa",
toHexString(buffer.rewind().putLong(0xffffaaaaL).rewind()));
+ assertEquals("00000000aaaabbbb",
toHexString(buffer.rewind().putLong(0xaaaabbbbL).rewind()));
+
+ assertEquals("", toHexString(buffer.rewind().putLong(0xffffaaaaL)));
+ assertEquals("", toHexString(buffer.rewind().putLong(0xaaaabbbbL)));
+
+ assertEquals("ffffaaaa",
toHexString(buffer.rewind().putLong(0xffffaaaaL).position(4)));
+ assertEquals("aaaabbbb",
toHexString(buffer.rewind().putLong(0xaaaabbbbL).position(4)));
+
+ assertEquals("00001111",
toHexString(buffer.rewind().limit(8).putLong(0x1111ffffaaaaL).rewind().limit(4)));
+ assertEquals("00002222",
toHexString(buffer.rewind().limit(8).putLong(0x2222aaaabbbbL).rewind().limit(4)));
+
+ buffer.rewind().limit(8);
+
+ // Checks slice.
+
+ assertEquals("ffffaaaa",
toHexString(buffer.rewind().putLong(0xffffaaaaL).position(4).slice()));
+ assertEquals("aaaabbbb",
toHexString(buffer.rewind().putLong(0xaaaabbbbL).position(4).slice()));
+ }
+}
diff --git
a/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsTest.java
index ffd5fd3b92..7768be4889 100644
---
a/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsTest.java
+++
b/modules/core/src/test/java/org/apache/ignite/internal/util/IgniteUtilsTest.java
@@ -26,13 +26,11 @@ import static
org.apache.ignite.internal.util.IgniteUtils.awaitForWorkersStop;
import static org.apache.ignite.internal.util.IgniteUtils.copyStateTo;
import static org.apache.ignite.internal.util.IgniteUtils.getUninterruptibly;
import static org.apache.ignite.internal.util.IgniteUtils.isPow2;
-import static org.apache.ignite.internal.util.IgniteUtils.toHexString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.arrayWithSize;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
-import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -42,7 +40,6 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import java.io.IOException;
-import java.nio.ByteBuffer;
import java.util.List;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
@@ -162,30 +159,6 @@ class IgniteUtilsTest extends BaseIgniteAbstractTest {
}).get(1, TimeUnit.SECONDS);
}
- @Test
- void testToHexStringByteBuffer() {
- ByteBuffer buffer = ByteBuffer.allocate(8);
-
- assertEquals("00000000ffffaaaa",
toHexString(buffer.rewind().putLong(0xffffaaaaL).rewind()));
- assertEquals("00000000aaaabbbb",
toHexString(buffer.rewind().putLong(0xaaaabbbbL).rewind()));
-
- assertEquals("", toHexString(buffer.rewind().putLong(0xffffaaaaL)));
- assertEquals("", toHexString(buffer.rewind().putLong(0xaaaabbbbL)));
-
- assertEquals("ffffaaaa",
toHexString(buffer.rewind().putLong(0xffffaaaaL).position(4)));
- assertEquals("aaaabbbb",
toHexString(buffer.rewind().putLong(0xaaaabbbbL).position(4)));
-
- assertEquals("00001111",
toHexString(buffer.rewind().limit(8).putLong(0x1111ffffaaaaL).rewind().limit(4)));
- assertEquals("00002222",
toHexString(buffer.rewind().limit(8).putLong(0x2222aaaabbbbL).rewind().limit(4)));
-
- buffer.rewind().limit(8);
-
- // Checks slice.
-
- assertEquals("ffffaaaa",
toHexString(buffer.rewind().putLong(0xffffaaaaL).position(4).slice()));
- assertEquals("aaaabbbb",
toHexString(buffer.rewind().putLong(0xaaaabbbbL).position(4).slice()));
- }
-
@Test
void testAwaitForWorkersStop() throws Exception {
IgniteWorker worker0 = mock(IgniteWorker.class);
diff --git
a/modules/page-memory/src/integrationTest/java/org/apache/ignite/internal/pagememory/tree/AbstractBplusTreePageMemoryTest.java
b/modules/page-memory/src/integrationTest/java/org/apache/ignite/internal/pagememory/tree/AbstractBplusTreePageMemoryTest.java
index e38f578c2a..58ccc1ca50 100644
---
a/modules/page-memory/src/integrationTest/java/org/apache/ignite/internal/pagememory/tree/AbstractBplusTreePageMemoryTest.java
+++
b/modules/page-memory/src/integrationTest/java/org/apache/ignite/internal/pagememory/tree/AbstractBplusTreePageMemoryTest.java
@@ -36,7 +36,7 @@ import static
org.apache.ignite.internal.testframework.IgniteTestUtils.runMultiT
import static
org.apache.ignite.internal.testframework.IgniteTestUtils.runMultiThreadedAsync;
import static
org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
import static org.apache.ignite.internal.util.Constants.GiB;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/datastructure/DataStructure.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/datastructure/DataStructure.java
index fe34fd6656..23c69b7980 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/datastructure/DataStructure.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/datastructure/DataStructure.java
@@ -39,7 +39,7 @@ import org.apache.ignite.internal.pagememory.reuse.ReuseList;
import org.apache.ignite.internal.pagememory.util.PageHandler;
import org.apache.ignite.internal.pagememory.util.PageIdUtils;
import org.apache.ignite.internal.pagememory.util.PageLockListener;
-import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.HexStringUtils;
import org.apache.ignite.lang.IgniteInternalCheckedException;
import org.apache.ignite.lang.util.StringUtils;
import org.jetbrains.annotations.Nullable;
@@ -454,7 +454,7 @@ public abstract class DataStructure implements
ManuallyCloseable {
recycled = PageIdUtils.rotatePageId(pageId);
}
- assert itemId(recycled) > 0 && itemId(recycled) <= MAX_ITEM_ID_NUM :
IgniteUtils.hexLong(recycled);
+ assert itemId(recycled) > 0 && itemId(recycled) <= MAX_ITEM_ID_NUM :
HexStringUtils.hexLong(recycled);
PageIo.setPageId(pageAddr, recycled);
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/PagesList.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/PagesList.java
index 3f0760c009..72fcea6817 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/PagesList.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/freelist/PagesList.java
@@ -32,7 +32,7 @@ import static
org.apache.ignite.internal.pagememory.util.PageIdUtils.pageId;
import static
org.apache.ignite.internal.pagememory.util.PageIdUtils.partitionId;
import static org.apache.ignite.internal.util.ArrayUtils.nullOrEmpty;
import static org.apache.ignite.internal.util.ArrayUtils.remove;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
import static org.apache.ignite.internal.util.IgniteUtils.isPow2;
import static org.apache.ignite.lang.IgniteSystemProperties.getBoolean;
import static org.apache.ignite.lang.IgniteSystemProperties.getInteger;
@@ -2133,4 +2133,3 @@ public abstract class PagesList extends DataStructure {
}
}
}
-
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/inmemory/VolatilePageMemory.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/inmemory/VolatilePageMemory.java
index 58e8147a40..f9a90181eb 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/inmemory/VolatilePageMemory.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/inmemory/VolatilePageMemory.java
@@ -43,6 +43,7 @@ import
org.apache.ignite.internal.pagememory.metric.IoStatisticsHolder;
import org.apache.ignite.internal.pagememory.metric.IoStatisticsHolderNoOp;
import org.apache.ignite.internal.pagememory.util.PageIdUtils;
import org.apache.ignite.internal.util.GridUnsafe;
+import org.apache.ignite.internal.util.HexStringUtils;
import org.apache.ignite.internal.util.IgniteUtils;
import org.apache.ignite.internal.util.OffheapReadWriteLock;
import org.apache.ignite.lang.IgniteInternalException;
@@ -322,7 +323,7 @@ public class VolatilePageMemory implements PageMemory {
throw oom;
}
- assert (relPtr & ~PageIdUtils.PAGE_IDX_MASK) == 0 :
IgniteUtils.hexLong(relPtr & ~PageIdUtils.PAGE_IDX_MASK);
+ assert (relPtr & ~PageIdUtils.PAGE_IDX_MASK) == 0 :
HexStringUtils.hexLong(relPtr & ~PageIdUtils.PAGE_IDX_MASK);
// Assign page ID according to flags and partition ID.
long pageId = PageIdUtils.pageId(partId, flags, (int) relPtr);
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/mem/unsafe/UnsafeChunk.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/mem/unsafe/UnsafeChunk.java
index 0d8109ac77..429c4edb83 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/mem/unsafe/UnsafeChunk.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/mem/unsafe/UnsafeChunk.java
@@ -19,7 +19,7 @@ package org.apache.ignite.internal.pagememory.mem.unsafe;
import org.apache.ignite.internal.pagememory.mem.DirectMemoryRegion;
import org.apache.ignite.internal.tostring.S;
-import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.HexStringUtils;
/**
* Basic implementation of {@link DirectMemoryRegion} that stores direct
memory address and the length of the region.
@@ -58,7 +58,7 @@ public class UnsafeChunk implements DirectMemoryRegion {
@Override
public DirectMemoryRegion slice(long offset) {
if (offset < 0 || offset >= len) {
- throw new IllegalArgumentException("Failed to create a memory
region slice [ptr=" + IgniteUtils.hexLong(ptr)
+ throw new IllegalArgumentException("Failed to create a memory
region slice [ptr=" + HexStringUtils.hexLong(ptr)
+ ", len=" + len + ", offset=" + offset + ']');
}
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PagePool.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PagePool.java
index 81c87e7117..bc71d49b6a 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PagePool.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PagePool.java
@@ -27,7 +27,7 @@ import static
org.apache.ignite.internal.util.GridUnsafe.compareAndSwapLong;
import static org.apache.ignite.internal.util.GridUnsafe.getLongVolatile;
import static org.apache.ignite.internal.util.GridUnsafe.putLong;
import static org.apache.ignite.internal.util.GridUnsafe.putLongVolatile;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.ignite.internal.pagememory.mem.DirectMemoryRegion;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
index 232f178568..4f11ab1454 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/PersistentPageMemory.java
@@ -50,11 +50,11 @@ import static
org.apache.ignite.internal.util.GridUnsafe.getLong;
import static org.apache.ignite.internal.util.GridUnsafe.putIntVolatile;
import static org.apache.ignite.internal.util.GridUnsafe.wrapPointer;
import static org.apache.ignite.internal.util.GridUnsafe.zeroMemory;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.toHexString;
import static org.apache.ignite.internal.util.IgniteUtils.hash;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
import static org.apache.ignite.internal.util.IgniteUtils.readableSize;
import static org.apache.ignite.internal.util.IgniteUtils.safeAbs;
-import static org.apache.ignite.internal.util.IgniteUtils.toHexString;
import static
org.apache.ignite.internal.util.OffheapReadWriteLock.TAG_LOCK_ALWAYS;
import java.nio.ByteBuffer;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/ReplaceCandidate.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/ReplaceCandidate.java
index 68278f48ba..1274cb539f 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/ReplaceCandidate.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/ReplaceCandidate.java
@@ -17,7 +17,7 @@
package org.apache.ignite.internal.pagememory.persistence;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
import org.apache.ignite.internal.pagememory.FullPageId;
import org.apache.ignite.internal.tostring.IgniteToStringInclude;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointPagesWriter.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointPagesWriter.java
index 2ae56c2fe9..f133eb4aa0 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointPagesWriter.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/checkpoint/CheckpointPagesWriter.java
@@ -23,8 +23,8 @@ import static
org.apache.ignite.internal.pagememory.io.PageIo.getVersion;
import static
org.apache.ignite.internal.pagememory.persistence.PartitionMeta.partitionMetaPageId;
import static
org.apache.ignite.internal.pagememory.persistence.PersistentPageMemory.TRY_AGAIN_TAG;
import static org.apache.ignite.internal.pagememory.util.PageIdUtils.flag;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
import static
org.apache.ignite.internal.util.IgniteConcurrentMultiPairQueue.EMPTY;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
import java.nio.ByteBuffer;
import java.util.ArrayList;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/AbstractFilePageStoreIo.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/AbstractFilePageStoreIo.java
index 7968d62b37..2ff681c800 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/AbstractFilePageStoreIo.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/AbstractFilePageStoreIo.java
@@ -21,10 +21,10 @@ import static java.nio.ByteOrder.nativeOrder;
import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.READ;
import static java.nio.file.StandardOpenOption.WRITE;
+import static org.apache.ignite.internal.util.HexStringUtils.hexInt;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.toHexString;
import static org.apache.ignite.internal.util.IgniteUtils.atomicMoveFile;
-import static org.apache.ignite.internal.util.IgniteUtils.hexInt;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
-import static org.apache.ignite.internal.util.IgniteUtils.toHexString;
import static org.apache.ignite.lang.IgniteSystemProperties.getBoolean;
import java.io.Closeable;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/DeltaFilePageStoreIoHeader.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/DeltaFilePageStoreIoHeader.java
index cb6f4a8d4d..8c5bc5a61f 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/DeltaFilePageStoreIoHeader.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/DeltaFilePageStoreIoHeader.java
@@ -18,7 +18,7 @@
package org.apache.ignite.internal.pagememory.persistence.store;
import static java.nio.ByteOrder.nativeOrder;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
import java.io.IOException;
import java.nio.ByteBuffer;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/FilePageStoreHeader.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/FilePageStoreHeader.java
index 44583924c1..56aba6bdd0 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/FilePageStoreHeader.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/store/FilePageStoreHeader.java
@@ -18,7 +18,7 @@
package org.apache.ignite.internal.pagememory.persistence.store;
import static java.nio.ByteOrder.nativeOrder;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
import java.io.IOException;
import java.nio.ByteBuffer;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/tree/BplusTree.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/tree/BplusTree.java
index 4d32c366af..d184d72645 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/tree/BplusTree.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/tree/BplusTree.java
@@ -32,7 +32,7 @@ import static
org.apache.ignite.internal.pagememory.util.PageIdUtils.effectivePa
import static org.apache.ignite.internal.util.ArrayUtils.OBJECT_EMPTY_ARRAY;
import static org.apache.ignite.internal.util.ArrayUtils.clearTail;
import static org.apache.ignite.internal.util.ArrayUtils.set;
-import static org.apache.ignite.internal.util.IgniteUtils.hexLong;
+import static org.apache.ignite.internal.util.HexStringUtils.hexLong;
import static org.apache.ignite.lang.IgniteSystemProperties.getInteger;
import it.unimi.dsi.fastutil.longs.LongArrayFIFOQueue;
diff --git
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/util/PageIdUtils.java
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/util/PageIdUtils.java
index 126bd03fd5..6e290a0226 100644
---
a/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/util/PageIdUtils.java
+++
b/modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/util/PageIdUtils.java
@@ -21,7 +21,7 @@ import static
org.apache.ignite.internal.pagememory.PageIdAllocator.FLAG_DATA;
import org.apache.ignite.internal.pagememory.FullPageId;
import org.apache.ignite.internal.pagememory.PageIdAllocator;
-import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.HexStringUtils;
/**
* Utility class for page ID parts manipulation.
@@ -88,7 +88,7 @@ public final class PageIdUtils {
*/
public static long link(long pageId, int itemId) {
assert itemId >= 0 && itemId <= MAX_ITEM_ID_NUM : itemId;
- assert (pageId >> ROTATION_ID_OFFSET) == 0 :
IgniteUtils.hexLong(pageId);
+ assert (pageId >> ROTATION_ID_OFFSET) == 0 :
HexStringUtils.hexLong(pageId);
return pageId | (((long) itemId) << ROTATION_ID_OFFSET);
}
diff --git
a/modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/util/PageIdUtilsTest.java
b/modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/util/PageIdUtilsTest.java
index 6726736e35..73708d7cea 100644
---
a/modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/util/PageIdUtilsTest.java
+++
b/modules/page-memory/src/test/java/org/apache/ignite/internal/pagememory/util/PageIdUtilsTest.java
@@ -21,7 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Random;
import org.apache.ignite.internal.pagememory.PageIdAllocator;
-import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.HexStringUtils;
import org.junit.jupiter.api.Test;
/**
@@ -131,8 +131,8 @@ public class PageIdUtilsTest {
long pageId = PageIdUtils.pageId(partId,
PageIdAllocator.FLAG_DATA, pageNum);
- String msg = "For values [offset=" + IgniteUtils.hexLong(off) + ",
fileId=" + IgniteUtils.hexLong(partId)
- + ", pageNum=" + IgniteUtils.hexLong(pageNum) + ']';
+ String msg = "For values [offset=" + HexStringUtils.hexLong(off) +
", fileId=" + HexStringUtils.hexLong(partId)
+ + ", pageNum=" + HexStringUtils.hexLong(pageNum) + ']';
assertEquals(pageId, PageIdUtils.pageId(pageId), msg);
assertEquals(0, PageIdUtils.itemId(pageId), msg);
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryIndexTest.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryIndexTest.java
index d29f0a49a5..cf629cc5c4 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryIndexTest.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryIndexTest.java
@@ -28,7 +28,7 @@ import
org.apache.ignite.internal.sql.engine.datatypes.tests.BaseIndexDataTypeTe
import org.apache.ignite.internal.sql.engine.datatypes.tests.DataTypeTestSpec;
import org.apache.ignite.internal.sql.engine.datatypes.tests.TestTypeArguments;
import org.apache.ignite.internal.sql.engine.util.VarBinary;
-import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.HexStringUtils;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
@@ -121,11 +121,11 @@ public class ItVarBinaryIndexTest extends
BaseIndexDataTypeTest<VarBinary> {
case LITERAL:
return spec.toLiteral(value);
case CAST: {
- String str = IgniteUtils.toHexString(value.get());
+ String str = HexStringUtils.toHexString(value.get());
return format("x'{}'::VARBINARY", str);
}
case CAST_WITH_PRECISION: {
- String str = IgniteUtils.toHexString(value.get());
+ String str = HexStringUtils.toHexString(value.get());
return format("x'{}'::VARBINARY(8)", str);
}
default:
diff --git
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/Query.java
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/Query.java
index a795c7ef38..92a03966ad 100644
---
a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/Query.java
+++
b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/sqllogic/Query.java
@@ -33,7 +33,7 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.calcite.avatica.util.ByteString;
import org.apache.ignite.internal.util.CollectionUtils;
-import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.HexStringUtils;
/**
* Executes an SQL query and expects the specified result and fails when that
result and an output of a query do not match.
@@ -384,7 +384,7 @@ final class Query extends Command {
}
}
- String res0 = IgniteUtils.toHexString(ctx.messageDigest.digest());
+ String res0 = HexStringUtils.toHexString(ctx.messageDigest.digest());
if (eqLabel != null) {
if (res0.equals(expectedHash)) {
diff --git
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/configuration/ValueSerializationHelper.java
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/configuration/ValueSerializationHelper.java
index 88a24d461d..562b617611 100644
---
a/modules/schema/src/main/java/org/apache/ignite/internal/schema/configuration/ValueSerializationHelper.java
+++
b/modules/schema/src/main/java/org/apache/ignite/internal/schema/configuration/ValueSerializationHelper.java
@@ -30,7 +30,7 @@ import java.util.Objects;
import java.util.UUID;
import org.apache.ignite.internal.schema.DecimalNativeType;
import org.apache.ignite.internal.schema.NativeType;
-import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.HexStringUtils;
/**
* Utility class to convert object to and from human readable string
representation.
@@ -66,9 +66,9 @@ public final class ValueSerializationHelper {
case UUID:
return defaultValue.toString();
case BYTES:
- return IgniteUtils.toHexString((byte[]) defaultValue);
+ return HexStringUtils.toHexString((byte[]) defaultValue);
case BITMASK:
- return IgniteUtils.toHexString(((BitSet)
defaultValue).toByteArray());
+ return HexStringUtils.toHexString(((BitSet)
defaultValue).toByteArray());
default:
throw new IllegalStateException("Unknown type [type=" + type +
']');
}
@@ -120,9 +120,9 @@ public final class ValueSerializationHelper {
case UUID:
return UUID.fromString(defaultValue);
case BYTES:
- return IgniteUtils.fromHexString(defaultValue);
+ return HexStringUtils.fromHexString(defaultValue);
case BITMASK:
- return BitSet.valueOf(IgniteUtils.fromHexString(defaultValue));
+ return
BitSet.valueOf(HexStringUtils.fromHexString(defaultValue));
default:
throw new IllegalStateException("Unknown type [type=" + type +
']');
}
diff --git
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/meta/IndexMeta.java
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/meta/IndexMeta.java
index afb928b440..8f3dfc0d0c 100644
---
a/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/meta/IndexMeta.java
+++
b/modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/index/meta/IndexMeta.java
@@ -20,7 +20,7 @@ package
org.apache.ignite.internal.storage.pagememory.index.meta;
import java.util.UUID;
import org.apache.ignite.internal.tostring.IgniteToStringExclude;
import org.apache.ignite.internal.tostring.S;
-import org.apache.ignite.internal.util.IgniteUtils;
+import org.apache.ignite.internal.util.HexStringUtils;
import org.jetbrains.annotations.Nullable;
/**
@@ -63,6 +63,6 @@ public class IndexMeta extends IndexMetaKey {
@Override
public String toString() {
- return S.toString(IndexMeta.class, this, "indexId=", indexId(),
"metaPageId", IgniteUtils.hexLong(metaPageId));
+ return S.toString(IndexMeta.class, this, "indexId=", indexId(),
"metaPageId", HexStringUtils.hexLong(metaPageId));
}
}