Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Alfonsi committed Oct 16, 2023
1 parent ae300e9 commit 7a7b41f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

package org.opensearch.common.metrics;

import java.io.Serializable;
import java.util.concurrent.atomic.LongAdder;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.indices.TierType;

import java.io.Serializable;
import java.util.EnumMap;

/**
Expand Down Expand Up @@ -113,7 +114,7 @@ public void onRemoval(Accountable key, BytesReference value, boolean evicted, Ti
statsHolder.get(tierType).totalMetric.dec(dec);
}

static class StatsHolder {
static class StatsHolder implements Serializable {

final CounterMetric evictionsMetric = new CounterMetric();
final CounterMetric totalMetric = new CounterMetric();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import org.opensearch.common.settings.Settings;
import org.opensearch.common.util.io.IOUtils;
import org.opensearch.core.common.bytes.AbstractBytesReference;
import org.opensearch.core.common.bytes.BytesArray;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.unit.ByteSizeValue;
import org.opensearch.core.index.shard.ShardId;
Expand Down Expand Up @@ -164,7 +165,8 @@ public void testAddDirectToEhcache() throws Exception {
BytesReference termBytes = XContentHelper.toXContent(termQuery, MediaTypeRegistry.JSON, false);
IndicesRequestCache.Key key = new IndicesRequestCache.Key(entity, reader.getReaderCacheHelper().getKey(), termBytes);

TestBytesReference value = new TestBytesReference(124);
//TestBytesReference value = new TestBytesReference(124);
BytesReference value = new BytesArray(new byte[]{0});
cache.tieredCacheHandler.getDiskCachingTier().put(key, value);

System.out.println("Size: " + cache.tieredCacheHandler.getDiskCachingTier().count());
Expand Down Expand Up @@ -707,7 +709,7 @@ public boolean isFragment() {
}
}

private class TestEntity extends AbstractIndexShardCacheEntity {
private class TestEntity extends AbstractIndexShardCacheEntity implements Serializable {
private final AtomicBoolean standInForIndexShard;
private final ShardRequestCache shardRequestCache;

Expand Down

0 comments on commit 7a7b41f

Please sign in to comment.