Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Es qat support only #10

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Conversation

ZJie1
Copy link
Contributor

@ZJie1 ZJie1 commented Feb 28, 2020

No description provided.

Copy link

@winningsix winningsix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two major comments: 1) could you remove unnecessary code changes like Hive and avoid committing .swp file; 2) the largest file is ES diff file. The diff may be due to different code styles in your local IDE from upstream. Can you revert unnecessary changes here? We will have multi-versions support for different components. So we will do patch for different versions. We need to keep changes as little as possible to lower the burden.

.gitignore Outdated
@@ -39,3 +39,5 @@ columnar_format_qat_wrapper/target/
javah/
jni-header/
target/
es_qat_wrapper_backup

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these two.

.getBufferAllocatorFactory().getBufferAllocator(compressedSize);
this.uncompressedBuffer = uncompressedBufferAllocator
.allocateDirectByteBuffer(useNativeBuffer, uncompressedSize, 64);
this.compressedBuffer = compressedBufferAllocator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we postpone the buffer allocate when use?

import java.io.IOException;
import java.io.InputStream;

public class NativeCodeLoader {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's refactor the code: 1) move NativeLoader into commons module (we need to create it) 2) reuse another nativeLoader in


options.forkOptions.memoryMaximumSize=2g

systemProp.http.proxyHost=child-prc.intel.com

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove those please. It's companies' info. Does not apply for others.

$ mvn clean install -Dqatzip.libs=/opt/intel/QATzip -Dqatzip.src=/opt/intel/QATzip -DskipTests
Then we can get the following files that we need.

path/to/IntelQatCodec/lucene_qat_wrapper/target/lucene_qat_wrapper.jar

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename path/to/IntelQatCodec to $IntelQATCodecSrcDri

@@ -0,0 +1,134 @@
#How to deploy the Elasticsearch with QAT

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can keep it in the doc. But I would suggest to change it to bash script.

# */
#!/bin/bash

declare -a supported_Elasticsearch_versions=("8.0.0")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems 8.0.0 has not been released. We should use a released version. https://www.elastic.co/guide/en/elasticsearch/reference/current/es-release-notes.html

declare -A es_lucene_version_m=(["8.0.0"]="8.2.0")

# Repo Address
ES_REPO=https://github.com/Intel-bigdata/elasticsearch.git

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use directly source code from ES official website?

}

public void testLUCENE5201() throws IOException {
byte[] data = new byte[]{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did we get those data? Can we runtime generate them?


public void testDecompress() throws IOException {
final int iterations = atLeast(10);
for (int i = 0; i < iterations; ++i) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the main purpose to repeat this for 10 times?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is for different segments. And I will remove the changes in this class because it was just for debugging convenience.

return arr;
}

byte[] compress(byte[] decompressed, int off, int len) throws IOException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use before/after test annotation here?


package org.apache.lucene.codecs.compressing;

public class TestQatCompressionDecompressionMode extends AbstractTestCompressionMode {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty test cases? We should move all test cases out of abstract class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not empty. Lucene has its own test code. Different CompressionMode will call the same code from AbstractTestCompressionMode. We just need to extend it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean you can move those test cases from abstract class to this class.

pom.xml Outdated Show resolved Hide resolved
@winningsix
Copy link

@ZJie1 Do you think this maintain mode is heavy to us?

@winningsix winningsix closed this Apr 9, 2020
@winningsix winningsix reopened this Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants