-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ZSTD compression for snapshotting (#2996)
Changes: - Added ZSTD compressor for snapshotting - 2 JSON repository settings: - readonly - compression were moved into the BlobStoreRepository class and removed from other repos classes where they were used. Signed-off-by: Andrey Pleskach <ples@aiven.io>
- Loading branch information
1 parent
e3740f7
commit 4df347c
Showing
30 changed files
with
729 additions
and
459 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,6 @@ bytebuddy = 1.14.3 | |
|
||
# benchmark dependencies | ||
jmh = 1.35 | ||
|
||
# compression | ||
zstd = 1.5.5-3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
sandbox/plugins/custom-codecs/licenses/zstd-jni-1.5.5-1.jar.sha1
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
488dd9b15c9e8cf87d857f65f5cd6359c2853381 |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
server/src/main/java/org/opensearch/common/compress/CompressorType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* 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.common.compress; | ||
|
||
/** | ||
* Supported compression types | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public enum CompressorType { | ||
|
||
DEFLATE { | ||
@Override | ||
public Compressor compressor() { | ||
return CompressorFactory.DEFLATE_COMPRESSOR; | ||
} | ||
}, | ||
|
||
ZSTD { | ||
@Override | ||
public Compressor compressor() { | ||
return CompressorFactory.ZSTD_COMPRESSOR; | ||
} | ||
}, | ||
|
||
NONE { | ||
@Override | ||
public Compressor compressor() { | ||
return CompressorFactory.NONE_COMPRESSOR; | ||
} | ||
}; | ||
|
||
public abstract Compressor compressor(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
server/src/main/java/org/opensearch/common/compress/NoneCompressor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* 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.common.compress; | ||
|
||
import org.opensearch.common.bytes.BytesReference; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
|
||
/** | ||
* {@link Compressor} no compressor implementation. | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class NoneCompressor implements Compressor { | ||
@Override | ||
public boolean isCompressed(BytesReference bytes) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public int headerLength() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public InputStream threadLocalInputStream(InputStream in) throws IOException { | ||
return in; | ||
} | ||
|
||
@Override | ||
public OutputStream threadLocalOutputStream(OutputStream out) throws IOException { | ||
return out; | ||
} | ||
|
||
@Override | ||
public BytesReference uncompress(BytesReference bytesReference) throws IOException { | ||
return bytesReference; | ||
} | ||
|
||
@Override | ||
public BytesReference compress(BytesReference bytesReference) throws IOException { | ||
return bytesReference; | ||
} | ||
|
||
} |
Oops, something went wrong.