timoninmaxim commented on a change in pull request #9569:
URL: https://github.com/apache/ignite/pull/9569#discussion_r751294793
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/mem/unsafe/UnsafeMemoryProvider.java
##########
@@ -75,7 +79,7 @@ public UnsafeMemoryProvider(IgniteLogger log) {
DirectMemoryRegion chunk = it.next();
if (deallocate) {
Review comment:
Looks like it's possible to skip iteration over regions in case
`deallocaiton is False`.
##########
File path: modules/numa-allocator/src/main/cpp/CMakeLists.txt
##########
@@ -0,0 +1,46 @@
+#
+# 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.
+#
+
+cmake_minimum_required(VERSION 3.6)
+project(numa_alloc)
+
+set (CMAKE_CXX_STANDARD 11)
Review comment:
rm whitespace
##########
File path:
modules/numa-allocator/src/main/java/org/apache/ignite/mem/NumaAllocator.java
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.mem;
+
+import java.io.Serializable;
+import org.apache.ignite.internal.mem.NumaAllocUtil;
+
+/** */
+public class NumaAllocator implements MemoryAllocator, Serializable {
Review comment:
Why does it specify the Serializable interface?
##########
File path:
modules/numa-allocator/src/test/java/org/apache/ignite/internal/mem/NumaAllocatorUnitTest.java
##########
@@ -0,0 +1,123 @@
+/*
+ * 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.mem;
+
+import java.util.Arrays;
+import java.util.stream.IntStream;
+import org.apache.ignite.internal.util.GridUnsafe;
+import org.apache.ignite.mem.InterleavedNumaAllocationStrategy;
+import org.apache.ignite.mem.LocalNumaAllocationStrategy;
+import org.apache.ignite.mem.NumaAllocationStrategy;
+import org.apache.ignite.mem.NumaAllocator;
+import org.apache.ignite.mem.SimpleNumaAllocationStrategy;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.experimental.runners.Enclosed;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+/** */
+@RunWith(Enclosed.class)
+public class NumaAllocatorUnitTest {
+ /** */
+ @RunWith(Parameterized.class)
+ public static class PositiveScenarioTest extends GridCommonAbstractTest {
+ /** */
+ private static final long BUF_SZ = 32 * 1024 * 1024;
+
+ /** */
+ private static final int[] EVEN_NODES = IntStream.range(0,
NumaAllocUtil.NUMA_NODES_CNT)
+ .filter(x -> x % 2 == 0).toArray();
+
+ /** */
+ private static final int[] ALL_NODES = IntStream.range(0,
NumaAllocUtil.NUMA_NODES_CNT).toArray();
+
+ /**
+ *
+ */
+ @Parameterized.Parameters(name = "allocationStrategy={0}")
+ public static Iterable<Object[]> data() {
+ return Arrays.asList(
+ new Object[] {new LocalNumaAllocationStrategy()},
+ new Object[] {new InterleavedNumaAllocationStrategy()},
+ new Object[] {new InterleavedNumaAllocationStrategy(new
int[0])},
+ new Object[] {new
InterleavedNumaAllocationStrategy(EVEN_NODES)},
+ new Object[] {new
InterleavedNumaAllocationStrategy(ALL_NODES)},
+ new Object[] {new SimpleNumaAllocationStrategy()},
+ new Object[] {new
SimpleNumaAllocationStrategy(NumaAllocUtil.NUMA_NODES_CNT - 1)}
+ );
+ }
+
+ /** */
+ @Parameterized.Parameter()
+ public NumaAllocationStrategy strategy;
+
+ /** */
+ @Test
+ public void test() {
+ NumaAllocator allocator = new NumaAllocator(strategy);
+
+ long ptr = 0;
+ try {
+ ptr = allocator.allocateMemory(BUF_SZ);
+
+ assertEquals(BUF_SZ, NumaAllocUtil.chunkSize(ptr));
+
+ GridUnsafe.setMemory(ptr, BUF_SZ, (byte)1);
+
+ for (long i = 0; i < BUF_SZ; i++) {
+ assertEquals((byte)1, GridUnsafe.getByte(ptr + i));
Review comment:
According to Ignite code inspections, oneliners should not be wrapped
with curly braces.
##########
File path:
modules/numa-allocator/src/test/java/org/apache/ignite/internal/mem/NumaAllocatorBasicTest.java
##########
@@ -0,0 +1,165 @@
+/*
+ * 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.mem;
+
+import java.util.Arrays;
+import java.util.concurrent.ThreadLocalRandom;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteDataStreamer;
+import org.apache.ignite.configuration.DataRegionConfiguration;
+import org.apache.ignite.configuration.DataStorageConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.cache.persistence.DataRegion;
+import org.apache.ignite.internal.util.typedef.G;
+import org.apache.ignite.mem.InterleavedNumaAllocationStrategy;
+import org.apache.ignite.mem.LocalNumaAllocationStrategy;
+import org.apache.ignite.mem.NumaAllocationStrategy;
+import org.apache.ignite.mem.NumaAllocator;
+import org.apache.ignite.mem.SimpleNumaAllocationStrategy;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+/** */
+@RunWith(Parameterized.class)
+public class NumaAllocatorBasicTest extends GridCommonAbstractTest {
+ /** */
+ private static final long INITIAL_SIZE = 30L * 1024 * 1024;
+
+ /** */
+ private static final long MAX_SIZE = 100L * 1024 * 1024;
+
+ /** */
+ private static final String TEST_CACHE = "test";
+
+ /** */
+ private static final byte[] BUF = new byte[4096];
+
+ /** */
+ private static final int NUM_NODES = 3;
+
+ static {
+ ThreadLocalRandom.current().nextBytes(BUF);
+ }
+
+ /** */
+ @Parameterized.Parameters(name = "allocationStrategy={0}")
+ public static Iterable<Object[]> data() {
+ return Arrays.asList(
+ new Object[] {new LocalNumaAllocationStrategy()},
+ new Object[] {new
InterleavedNumaAllocationStrategy(IntStream.range(0,
NumaAllocUtil.NUMA_NODES_CNT)
+ .toArray())},
+ new Object[] {new
SimpleNumaAllocationStrategy(NumaAllocUtil.NUMA_NODES_CNT - 1)}
+ );
+ }
+
+ /** */
+ @Parameterized.Parameter()
+ public NumaAllocationStrategy strategy;
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String
igniteInstanceName) throws Exception {
+ IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
+
+ DataStorageConfiguration memCfg = new DataStorageConfiguration()
+ .setDefaultDataRegionConfiguration(new DataRegionConfiguration()
+ .setInitialSize(INITIAL_SIZE)
+ .setMaxSize(MAX_SIZE)
+ .setMetricsEnabled(true)
+ .setMemoryAllocator(new NumaAllocator(strategy)));
+
+ cfg.setDataStorageConfiguration(memCfg);
+
+ return cfg;
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void beforeTest() throws Exception {
+ super.beforeTest();
+
+ startGrids(NUM_NODES);
+ }
+
+ /** {@inheritDoc} */
+ @Override protected void afterTest() throws Exception {
+ super.afterTest();
+
+ stopAllGrids(true);
+ }
+
+ /** */
+ @Test
+ public void testLoadData() throws Exception {
+ IgniteEx client = startClientGrid("client");
+
+ client.getOrCreateCache(TEST_CACHE);
+
+ try (IgniteDataStreamer<Integer, byte[]> ds =
client.dataStreamer(TEST_CACHE)) {
+ int cnt = 0;
+ while (hasFreeSpace()) {
+ ds.addData(++cnt, BUF);
+
+ if (cnt % 100 == 0)
+ ds.flush();
+ }
+ }
+
+ assertEquals(NUM_NODES, serverGrids().count());
+
+ serverGrids().forEach(g -> {
+ DataRegion dr = getDefaultRegion(g);
+
+ log().info("Allocated memory size on node " + g.name() + " :" +
dr.metrics().getTotalAllocatedSize());
+
+ assertTrue(dr.metrics().getTotalAllocatedSize() > INITIAL_SIZE);
Review comment:
This will be always `true` because we already check this inside
`hasFreeSpace`. I'd suggest to add an Assert in the while loop that the amount
of allocated memory was changed after flushing data stream.
##########
File path:
modules/numa-allocator/src/test/java/org/apache/ignite/internal/mem/NumaAllocatorUnitTest.java
##########
@@ -0,0 +1,123 @@
+/*
+ * 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.mem;
+
+import java.util.Arrays;
+import java.util.stream.IntStream;
+import org.apache.ignite.internal.util.GridUnsafe;
+import org.apache.ignite.mem.InterleavedNumaAllocationStrategy;
+import org.apache.ignite.mem.LocalNumaAllocationStrategy;
+import org.apache.ignite.mem.NumaAllocationStrategy;
+import org.apache.ignite.mem.NumaAllocator;
+import org.apache.ignite.mem.SimpleNumaAllocationStrategy;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.experimental.runners.Enclosed;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+/** */
+@RunWith(Enclosed.class)
+public class NumaAllocatorUnitTest {
+ /** */
+ @RunWith(Parameterized.class)
+ public static class PositiveScenarioTest extends GridCommonAbstractTest {
+ /** */
+ private static final long BUF_SZ = 32 * 1024 * 1024;
Review comment:
32L
##########
File path: modules/numa-allocator/src/main/cpp/src/numa/numa_alloc.cpp
##########
@@ -0,0 +1,189 @@
+/*
+ * 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.
+ */
+
+#include <numa.h>
+#include <numa/numa_alloc.h>
+
+namespace numa {
+ class BitSet::BitSetImpl {
+ public:
+ BitSetImpl(): size(numa_max_node() + 1) {
+ mask = numa_bitmask_alloc(size);
+ }
+
+ BitSetImpl(const BitSetImpl& other): size(other.size) {
+ mask = numa_bitmask_alloc(size);
+ copy_bitmask_to_bitmask(other.mask, mask);
+ }
+
+ void SetBit(size_t idx, bool val) {
+ if (val)
+ numa_bitmask_setbit(mask, idx);
+ else
+ numa_bitmask_clearbit(mask, idx);
+ }
+
+ void SetAll(bool val) {
+ if (val)
+ numa_bitmask_setall(mask);
+ else
+ numa_bitmask_clearall(mask);
+ }
+
+ bool GetBit(size_t idx) const {
+ return numa_bitmask_isbitset(mask, idx);
+ }
+
+ bool Equals(const BitSetImpl& other) const {
+ return numa_bitmask_equal(mask, other.mask);
+ }
+
+ size_t Size() const {
+ return size;
+ }
+
+ bitmask* Raw() {
+ return mask;
+ }
+
+ ~BitSetImpl() {
+ numa_bitmask_free(mask);
+ }
+ private:
+ bitmask* mask;
+ size_t size;
+ };
+
+ BitSet::BitSet() {
+ pImpl = new BitSetImpl();
+ }
+
+ BitSet::BitSet(const BitSet &other) {
+ pImpl = new BitSetImpl(*other.pImpl);
+ }
+
+ BitSet& BitSet::operator=(const BitSet &other) {
+ if (this != &other) {
+ BitSet tmp(other);
+ std::swap(this->pImpl, tmp.pImpl);
+ }
+ return *this;
+ }
+
+ bool BitSet::Get(size_t pos) const {
+ return pImpl->GetBit(pos);
+ }
+
+ void BitSet::Set(size_t pos, bool value) {
+ pImpl->SetBit(pos, value);
+ }
+
+ void BitSet::Set() {
+ pImpl->SetAll(true);
+ }
+
+ void BitSet::Reset(size_t pos) {
+ pImpl->SetBit(pos, false);
+ }
+
+ void BitSet::Reset() {
+ pImpl->SetAll(false);
+ }
+
+ size_t BitSet::Size() const {
+ return pImpl->Size();
+ }
+
+ bool BitSet::operator==(const BitSet &other) {
+ return this->pImpl->Equals(*other.pImpl);
+ }
+
+ bool BitSet::operator!=(const BitSet &other) {
+ return !(*this == other);
+ }
+
+ BitSet::~BitSet() {
+ delete pImpl;
+ }
+
+ std::ostream &operator<<(std::ostream &os, const BitSet &set) {
+ os << '{';
+ for (size_t i = 0; i < set.Size(); ++i) {
+ os << set[i];
+ if (i < set.Size() - 1) {
+ os << ", ";
+ }
+ }
+ os << '}';
+ return os;
+ }
+
+ union region_size {
+ size_t size;
+ max_align_t a;
+ };
+
+ int NumaNodesCount() {
+ return numa_max_node() + 1;
Review comment:
Should we add here, or somewhere a call `numa_available()` for ensure
that it is possible to use NumaAllocator at all? Maybe we should add a such
assertion in a constructor of the allocator java instance? WDYT?
##########
File path: modules/core/src/main/java/org/apache/ignite/mem/MemoryAllocator.java
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.mem;
+
+/** */
+public interface MemoryAllocator {
+ /**
+ * @param size Size of allocated memory.
+ *
+ * @return Pointer to memory.
+ */
+ long allocateMemory(long size);
Review comment:
Ignite's code inspections require to mark all methods in interfaces with
`public`.
##########
File path: modules/numa-allocator/src/test/resources/example-ignite.xml
##########
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+-->
+
+<!--
+ Ignite configuration with all defaults and enabled p2p deployment and
enabled events.
Review comment:
Comment mismatches the content
##########
File path:
modules/core/src/main/java/org/apache/ignite/configuration/DataRegionConfiguration.java
##########
@@ -152,6 +153,9 @@
/** Warm-up configuration. */
@Nullable private WarmUpConfiguration warmUpCfg;
+ /** Memory allocator. */
Review comment:
Let's add a mention about default behavior.
##########
File path:
modules/numa-allocator/src/main/java/org/apache/ignite/mem/LocalNumaAllocationStrategy.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.mem;
+
+import java.io.Serializable;
+import org.apache.ignite.internal.mem.NumaAllocUtil;
+import org.apache.ignite.internal.util.tostring.GridToStringBuilder;
+
+/** */
+public class LocalNumaAllocationStrategy implements NumaAllocationStrategy,
Serializable {
Review comment:
Why does it specify the Serializable interface?
##########
File path: modules/numa-allocator/src/test/resources/example-ignite.xml
##########
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ 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.
+-->
+
+<!--
+ Ignite configuration with all defaults and enabled p2p deployment and
enabled events.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="dataStorageConfiguration">
+ <bean
class="org.apache.ignite.configuration.DataStorageConfiguration">
+ <property name="defaultDataRegionConfiguration">
+ <bean
class="org.apache.ignite.configuration.DataRegionConfiguration">
+ <property name="name" value="Default_Region"/>
+ <!-- 100 MB memory region with disabled eviction -->
Review comment:
100MB --> 2GB
##########
File path: modules/core/src/main/java/org/apache/ignite/mem/MemoryAllocator.java
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.mem;
+
+/** */
+public interface MemoryAllocator {
+ /**
+ * @param size Size of allocated memory.
+ *
+ * @return Pointer to memory.
Review comment:
WDYT, should this desc contain a short comment that method can return 0
in case underlying methods fails?
##########
File path:
modules/numa-allocator/src/main/java/org/apache/ignite/internal/mem/NumaAllocUtil.java
##########
@@ -0,0 +1,112 @@
+/*
+ * 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.mem;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/** */
+public class NumaAllocUtil {
+ /** */
+ private static final String extension = ".so";
Review comment:
Should we add a var for the "libnuma_alloc" String too?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]