Skip to content

Commit

Permalink
fix missing javadoc and relocate the common compress to compress package
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Aug 11, 2023
1 parent 57402b8 commit ccb01d8
Show file tree
Hide file tree
Showing 29 changed files with 111 additions and 29 deletions.
1 change: 1 addition & 0 deletions gradle/missing-javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ configure([
configure([
project(":libs:opensearch-common"),
project(":libs:opensearch-core"),
project(":libs:opensearch-compress"),
project(":plugins:events-correlation-engine"),
project(":server")
]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.github.luben.zstd.ZstdInputStreamNoFinalizer;
import com.github.luben.zstd.ZstdOutputStreamNoFinalizer;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
* compatible open source license.
*/

/** Classes for core compress module */
package org.opensearch.core.common.compress;
/**
* Concrete {@link org.opensearch.core.compress.Compressor} implementations
*/
package org.opensearch.compress;
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.opensearch.compress.spi;

import org.opensearch.compress.ZstdCompressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.core.compress.CompressorRegistry;
import org.opensearch.core.compress.spi.CompressorProvider;

Expand All @@ -21,7 +22,7 @@
*/
public class CompressionProvider implements CompressorProvider {

/** Returns the concrete {@link org.opensearch.core.common.compress.Compressor}s provided by the compress library */
/** Returns the concrete {@link Compressor}s provided by the compress library */
@Override
public List<CompressorRegistry.Entry> getCompressors() {
return List.of(new CompressorRegistry.Entry(ZstdCompressor.NAME, new ZstdCompressor()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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.
*/

/**
* Service Provider Interface for registering concrete {@link org.opensearch.core.compress.Compressor}
* implementations.
*
* See {@link org.opensearch.compress.ZstdCompressor}
*/
package org.opensearch.compress.spi;
13 changes: 13 additions & 0 deletions libs/compress/src/main/java/org/opensearch/package-info.java
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.
*/

/**
* This is the compress library for registering optional
* {@link org.opensearch.core.compress.Compressor} implementations
*/
package org.opensearch;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.opensearch.compress;

import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.test.core.compress.AbstractCompressorTestCase;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
import org.opensearch.common.CheckedRunnable;
import org.opensearch.common.CheckedSupplier;
import org.opensearch.common.Nullable;
import org.opensearch.core.common.compress.NotXContentException;
import org.opensearch.core.compress.NotXContentException;
import org.opensearch.core.concurrency.OpenSearchRejectedExecutionException;
import org.opensearch.core.index.Index;
import org.opensearch.core.rest.RestStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/

package org.opensearch.core.common.compress;
package org.opensearch.core.compress;

import org.opensearch.core.common.bytes.BytesReference;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

import org.opensearch.common.Nullable;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.common.compress.NotCompressedException;
import org.opensearch.core.common.compress.NotXContentException;
import org.opensearch.core.compress.spi.CompressorProvider;
import org.opensearch.core.xcontent.MediaTypeRegistry;

Expand Down Expand Up @@ -50,6 +47,12 @@ private CompressorRegistry() {}
NONE = registeredCompressors.get(NoneCompressor.NAME);
}

/**
* An entry for registering a concrete {@link Compressor} identified by a unique String key
*
* @opensearch.api
* @opensearch.experimental
*/
public static class Entry {
/** a unique key name to identify the compressor; this is typically the Compressor's Header as a string */
private String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
package org.opensearch.core.compress;

import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.compress.Compressor;

import java.io.IOException;
import java.io.InputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/

package org.opensearch.core.common.compress;
package org.opensearch.core.compress;

/**
* Exception indicating that we were expecting something compressed, which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* GitHub history for details.
*/

package org.opensearch.core.common.compress;
package org.opensearch.core.compress;

import org.opensearch.core.xcontent.XContent;

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

/**
* Concrete {@link org.opensearch.core.compress.Compressor} implementations provided by the core library
*
* See {@link org.opensearch.core.compress.NoneCompressor}
*/
package org.opensearch.core.compress;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package org.opensearch.core.compress.spi;

import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.core.compress.CompressorRegistry;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@

package org.opensearch.core.compress.spi;

import org.opensearch.core.compress.Compressor;
import org.opensearch.core.compress.CompressorRegistry;
import org.opensearch.core.compress.NoneCompressor;

import java.util.List;

/**
* Default {@link org.opensearch.core.common.compress.Compressor} implementations provided by the
* Default {@link Compressor} implementations provided by the
* opensearch core library
*
* @opensearch.internal
*/
public class DefaultCompressorProvider implements CompressorProvider {
/** Returns the default {@link org.opensearch.core.common.compress.Compressor}s provided by the core library */
/** Returns the default {@link Compressor}s provided by the core library */
@Override
public List<CompressorRegistry.Entry> getCompressors() {
return List.of(new CompressorRegistry.Entry(NoneCompressor.NAME, new NoneCompressor()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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.
*/

/**
* The Service Provider Interface implementation for registering {@link org.opensearch.core.compress.Compressor}
* with the {@link org.opensearch.core.compress.CompressorRegistry}
*
* See {@link org.opensearch.core.compress.spi.DefaultCompressorProvider} as an example of registering the core
* {@link org.opensearch.core.compress.NoneCompressor}
*/
package org.opensearch.core.compress.spi;
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.opensearch.common.CheckedConsumer;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.core.common.io.stream.InputStreamStreamInput;
import org.opensearch.core.common.io.stream.NamedWriteableAwareStreamInput;
import org.opensearch.core.common.io.stream.NamedWriteableRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.common.io.Streams;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;
import org.opensearch.core.compress.CompressorRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.opensearch.common.lease.Releasable;
import org.opensearch.core.Assertions;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
package org.opensearch.common.compress.spi;

import org.opensearch.common.compress.DeflateCompressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.core.compress.CompressorRegistry;
import org.opensearch.core.compress.spi.CompressorProvider;

import java.util.List;

/**
* Default {@link org.opensearch.core.common.compress.Compressor} implementations provided by the
* Default {@link Compressor} implementations provided by the
* opensearch core library
*
* @opensearch.internal
Expand All @@ -25,7 +26,7 @@
*/
@Deprecated
public class ServerCompressorProvider implements CompressorProvider {
/** Returns the concrete {@link org.opensearch.core.common.compress.Compressor}s provided by the server module */
/** Returns the concrete {@link Compressor}s provided by the server module */
@Override
public List<CompressorRegistry.Entry> getCompressors() {
return List.of(new CompressorRegistry.Entry(DeflateCompressor.NAME, new DeflateCompressor()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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.
*/

/**
* Service Provider Interface for registering the{@link org.opensearch.common.compress.DeflateCompressor} with the
* {@link org.opensearch.core.compress.CompressorRegistry}.
*
* Note: this will be refactored to the {@code :libs:opensearch-compress} library after other dependency classes are
* refactored.
*/
package org.opensearch.common.compress.spi;
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.opensearch.common.collect.Tuple;
import org.opensearch.core.common.bytes.BytesArray;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.core.compress.CompressorRegistry;
import org.opensearch.core.xcontent.DeprecationHandler;
import org.opensearch.core.xcontent.MediaType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.common.collect.Tuple;
import org.opensearch.common.lifecycle.AbstractLifecycleComponent;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.common.compress.NotXContentException;
import org.opensearch.core.compress.Compressor;
import org.opensearch.core.compress.NotXContentException;
import org.opensearch.common.io.Streams;
import org.opensearch.common.lucene.Lucene;
import org.opensearch.common.lucene.store.InputStreamIndexInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.opensearch.cluster.metadata.Metadata;
import org.opensearch.common.CheckedFunction;
import org.opensearch.common.blobstore.BlobContainer;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.common.io.Streams;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.common.lucene.store.ByteArrayIndexInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import org.opensearch.common.util.PageCacheRecycler;
import org.opensearch.core.common.bytes.BytesArray;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.core.compress.CompressorRegistry;

import java.io.Closeable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

package org.opensearch.common.compress;

import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.test.core.compress.AbstractCompressorTestCase;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import org.apache.lucene.tests.util.TestUtil;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.common.io.stream.BytesStreamOutput;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.test.OpenSearchTestCase;
import org.junit.Assert;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import org.apache.lucene.tests.util.LineFileDocs;
import org.apache.lucene.tests.util.TestUtil;
import org.opensearch.core.common.compress.Compressor;
import org.opensearch.core.compress.Compressor;
import org.opensearch.test.OpenSearchTestCase;

import java.io.ByteArrayInputStream;
Expand Down

0 comments on commit ccb01d8

Please sign in to comment.