Skip to content

Commit

Permalink
rename descriptive symbols
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Kao <[email protected]>
  • Loading branch information
seankao-az committed Jun 13, 2024
1 parent f4e90e4 commit 819f711
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public interface FlintClient {
* Start a new optimistic transaction.
*
* @param indexName index name
* @param forceInit forceInit create empty translog if not exist.
* @param initIfNotExist initIfNotExist create empty translog if not exist.
* @return transaction handle
*/
<T> OptimisticTransaction<T> startTransaction(String indexName, boolean forceInit);
<T> OptimisticTransaction<T> startTransaction(String indexName, boolean initIfNotExist);

/**
* Create a Flint index with the metadata given.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public interface FlintMetadataLogService {
* Start a new optimistic transaction.
*
* @param indexName index name
* @param forceInit forceInit create empty metadata log if not exist.
* @param initIfNotExist initIfNotExist create empty metadata log if not exist.
* @return transaction handle
*/
<T> OptimisticTransaction<T> startTransaction(String indexName, boolean forceInit);
<T> OptimisticTransaction<T> startTransaction(String indexName, boolean initIfNotExist);

/**
* Start a new optimistic transaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public FlintOpenSearchClient(FlintOptions options) {
}

@Override
public <T> OptimisticTransaction<T> startTransaction(String indexName, boolean forceInit) {
return metadataLogService.startTransaction(indexName, forceInit);
public <T> OptimisticTransaction<T> startTransaction(String indexName, boolean initIfNotExist) {
return metadataLogService.startTransaction(indexName, initIfNotExist);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ public class FlintOpenSearchMetadataLogService implements FlintMetadataLogServic

private static final Logger LOG = Logger.getLogger(FlintOpenSearchMetadataLogService.class.getName());

/**
* Metadata log index name prefix
*/
public final static String META_LOG_NAME_PREFIX = ".query_execution_request";
public final static String METADATA_LOG_INDEX_NAME_PREFIX = ".query_execution_request";

private final FlintOptions options;
private final String dataSourceName;
Expand Down Expand Up @@ -87,7 +84,7 @@ private void initIndexMetadataLog() {
}

private String constructMetaLogIndexName() {
return dataSourceName.isEmpty() ? META_LOG_NAME_PREFIX : META_LOG_NAME_PREFIX + "_" + dataSourceName;
return dataSourceName.isEmpty() ? METADATA_LOG_INDEX_NAME_PREFIX : METADATA_LOG_INDEX_NAME_PREFIX + "_" + dataSourceName;
}

private IRestHighLevelClient createOpenSearchClient() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.opensearch.common.xcontent.XContentType
import org.opensearch.flint.core.metadata.log.FlintMetadataLogEntry
import org.opensearch.flint.core.metadata.log.FlintMetadataLogEntry.{QUERY_EXECUTION_REQUEST_MAPPING, QUERY_EXECUTION_REQUEST_SETTINGS}
import org.opensearch.flint.core.metadata.log.FlintMetadataLogEntry.IndexState.IndexState
import org.opensearch.flint.core.storage.FlintOpenSearchMetadataLogService.META_LOG_NAME_PREFIX
import org.opensearch.flint.core.storage.FlintOpenSearchMetadataLogService.METADATA_LOG_INDEX_NAME_PREFIX
import org.opensearch.flint.spark.FlintSparkSuite

import org.apache.spark.sql.flint.config.FlintSparkConf.DATA_SOURCE_NAME
Expand All @@ -31,7 +31,7 @@ import org.apache.spark.sql.flint.config.FlintSparkConf.DATA_SOURCE_NAME
trait OpenSearchTransactionSuite extends FlintSparkSuite {

val testDataSourceName = "myglue"
lazy val testMetaLogIndex: String = META_LOG_NAME_PREFIX + "_" + testDataSourceName
lazy val testMetaLogIndex: String = METADATA_LOG_INDEX_NAME_PREFIX + "_" + testDataSourceName

override def beforeAll(): Unit = {
super.beforeAll()
Expand Down

0 comments on commit 819f711

Please sign in to comment.