0
if it's not present in the stats
*/
public long get(String field) {
- return stats.get(field);
+ return stats.getOrDefault(field, 0L);
}
/**
diff --git a/server/src/main/java/org/opensearch/common/collect/HppcMaps.java b/server/src/main/java/org/opensearch/common/collect/HppcMaps.java
deleted file mode 100644
index 2fd7316accf6e..0000000000000
--- a/server/src/main/java/org/opensearch/common/collect/HppcMaps.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * SPDX-License-Identifier: Apache-2.0
- *
- * The OpenSearch Contributors require contributions made to
- * this file be licensed under the Apache-2.0 license or a
- * compatible open source license.
- */
-
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch 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.
- */
-
-/*
- * Modifications Copyright OpenSearch Contributors. See
- * GitHub history for details.
- */
-
-package org.opensearch.common.collect;
-
-import com.carrotsearch.hppc.ObjectIntHashMap;
-import com.carrotsearch.hppc.ObjectLookupContainer;
-import com.carrotsearch.hppc.ObjectObjectHashMap;
-import com.carrotsearch.hppc.cursors.ObjectCursor;
-
-import java.util.Iterator;
-
-/**
- * High performance maps
- *
- * @opensearch.internal
- */
-public final class HppcMaps {
-
- private HppcMaps() {}
-
- /**
- * Returns a new map with the given number of expected elements.
- *
- * @param expectedElements
- * The expected number of elements guaranteed not to cause buffer
- * expansion (inclusive).
- */
- public static null
keys
- */
- public static null
keys
- *
- * @param expectedElements
- * The expected number of elements guaranteed not to cause buffer
- * expansion (inclusive).
- */
- public static null
keys.
- *
- * @param expectedElements
- * The expected number of elements guaranteed not to cause buffer
- * expansion (inclusive).
- */
- public static
- * Can be constructed using a {@link #builder()}, or using {@link #builder(org.opensearch.common.collect.ImmutableOpenIntMap)}
- * (which is an optimized option to copy over existing content and modify it).
- *
- * @opensearch.internal
- */
-public final class ImmutableOpenIntMap
- * Important note: For primitive type values, the value returned for a non-existing
- * key may not be the default value of the primitive type (it may be any value previously
- * assigned to that slot).
- */
- public VType get(int key) {
- return map.get(key);
- }
-
- /**
- * Returns
- * The true
if this container has an association to a value for
- * the given key.
- */
- public boolean containsKey(int key) {
- return map.containsKey(key);
- }
-
- /**
- * @return Returns the current size (number of assigned keys) in the container.
- */
- public int size() {
- return map.size();
- }
-
- /**
- * @return Return true
if this hash map contains no assigned keys.
- */
- public boolean isEmpty() {
- return map.isEmpty();
- }
-
- /**
- * Returns a cursor over the entries (key-value pairs) in this map. The iterator is
- * implemented as a cursor and it returns the same cursor instance on every
- * call to {@link java.util.Iterator#next()}. To read the current key and value use the cursor's
- * public fields. An example is shown below.
- *
- * for (IntShortCursor c : intShortMap)
- * {
- * System.out.println("index=" + c.index
- * + " key=" + c.key
- * + " value=" + c.value);
- * }
- *
- * index
field inside the cursor gives the internal index inside
- * the container's implementation. The interpretation of this index depends on
- * to the container.
- */
- @Override
- public Iterator