Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package org.elasticsearch.common.util;

import com.carrotsearch.hppc.ObjectArrayList;

import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefArray;
import org.apache.lucene.util.BytesRefBuilder;
Expand Down Expand Up @@ -67,7 +65,8 @@ public static <T> List<T> rotate(final List<T> list, int distance) {
return new RotatedList<>(list, d);
}

public static void sortAndDedup(final ObjectArrayList<byte[]> array) {
// this method is meant to be sort and deduplicate "in situ" (no additional memory)
public static void sortAndDedup(final ArrayList<byte[]> array) {
int len = array.size();
if (len > 1) {
sort(array);
Expand All @@ -77,11 +76,11 @@ public static void sortAndDedup(final ObjectArrayList<byte[]> array) {
array.set(uniqueCount++, array.get(i));
}
}
array.elementsCount = uniqueCount;
array.subList(uniqueCount, array.size()).clear();
}
}

public static void sort(final ObjectArrayList<byte[]> array) {
public static void sort(final ArrayList<byte[]> array) {
new IntroSorter() {

byte[] pivot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

package org.elasticsearch.index.mapper;

import com.carrotsearch.hppc.ObjectArrayList;

import org.apache.lucene.document.StoredField;
import org.apache.lucene.search.Query;
import org.apache.lucene.util.BytesRef;
Expand All @@ -28,6 +26,7 @@

import java.io.IOException;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -194,13 +193,13 @@ protected String contentType() {

public static class CustomBinaryDocValuesField extends CustomDocValuesField {

private final ObjectArrayList<byte[]> bytesList;
private final ArrayList<byte[]> bytesList;

private int totalSize = 0;

public CustomBinaryDocValuesField(String name, byte[] bytes) {
super(name);
bytesList = new ObjectArrayList<>();
bytesList = new ArrayList<>();
add(bytes);
}

Expand Down