Skip to content

Commit

Permalink
Change keystore implementation to live in a module
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Alfonsi <[email protected]>
  • Loading branch information
Peter Alfonsi committed Jan 26, 2024
1 parent 9790c16 commit 48185f8
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 57 deletions.
18 changes: 18 additions & 0 deletions modules/roaringbitmap-keystore/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.
*/

opensearchplugin {
description 'Roaring bitmap-based implementation of a key lookup store, used for tiered caching.'
classname 'org.opensearch.cache.RoaringBitmapKeystorePlugin'
hasClientJar = true
}

dependencies {
api 'org.roaringbitmap:RoaringBitmap:0.9.49'
runtimeOnly 'org.roaringbitmap:shims:0.9.49'
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* compatible open source license.
*/

package org.opensearch.common.cache.tier.keystore;
package org.opensearch.cache;

import org.opensearch.common.metrics.CounterMetric;

Expand Down Expand Up @@ -35,3 +35,4 @@ protected KeyStoreStats(long memSizeCapInBytes) {
this.numSuccessfulRemovals = new CounterMetric();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,11 @@
* 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.
*/
package org.opensearch.cache;

/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

package org.opensearch.common.cache.tier.keystore;

import org.opensearch.common.cache.tier.keystore.KeyLookupStore;
import org.opensearch.common.metrics.CounterMetric;
import org.opensearch.common.settings.ClusterSettings;
import org.opensearch.common.settings.Setting;
import org.opensearch.core.common.unit.ByteSizeValue;

import java.util.HashMap;
Expand Down Expand Up @@ -407,3 +383,4 @@ protected void setMemSizeCap(ByteSizeValue newMemSizeCap) {
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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.
*/

package org.opensearch.cache;
import org.opensearch.plugins.Plugin;

public class RoaringBitmapKeystoreModulePlugin extends Plugin {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,7 @@
* 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.cache.tier.keystore;
package org.opensearch.cache;

import org.opensearch.common.Randomness;
import org.opensearch.common.metrics.CounterMetric;
Expand Down Expand Up @@ -429,3 +406,4 @@ public void testSetMemSizeCap() throws Exception {
assertFalse(kls.add(rand.nextInt()));
}
}

4 changes: 0 additions & 4 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ dependencies {
api "com.google.protobuf:protobuf-java:${versions.protobuf}"
api "jakarta.annotation:jakarta.annotation-api:${versions.jakarta_annotation}"

// roaring bitmaps
api 'org.roaringbitmap:RoaringBitmap:0.9.49'
runtimeOnly 'org.roaringbitmap:shims:0.9.49' // might fix complaining about ArraysShims?

testImplementation(project(":test:framework")) {
// tests use the locally compiled version of server
exclude group: 'org.opensearch', module: 'server'
Expand Down
1 change: 0 additions & 1 deletion server/licenses/RoaringBitmap-0.9.49.jar.sha1

This file was deleted.

1 change: 0 additions & 1 deletion server/licenses/shims-0.9.49.jar.sha1

This file was deleted.

0 comments on commit 48185f8

Please sign in to comment.