Skip to content

Commit

Permalink
descriptive parameter name and update comment
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 819f711 commit 6b86c11
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 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 initIfNotExist initIfNotExist create empty translog if not exist.
* @param forceInit force init transaction and create empty translog if not exist
* @return transaction handle
*/
<T> OptimisticTransaction<T> startTransaction(String indexName, boolean initIfNotExist);
<T> OptimisticTransaction<T> startTransaction(String indexName, boolean forceInit);

/**
* 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 initIfNotExist initIfNotExist create empty metadata log if not exist.
* @param forceInit force init transaction and create empty metadata log if not exist
* @return transaction handle
*/
<T> OptimisticTransaction<T> startTransaction(String indexName, boolean initIfNotExist);
<T> OptimisticTransaction<T> startTransaction(String indexName, boolean forceInit);

/**
* Start a new optimistic transaction.
Expand All @@ -36,10 +36,10 @@ default <T> OptimisticTransaction<T> startTransaction(String indexName) {
* Get metadata log for index.
*
* @param indexName index name
* @param forceInit forceInit create empty metadata log if not exist
* @param initIfNotExist create empty metadata log if not exist
* @return optional metadata log
*/
Optional<FlintMetadataLog<FlintMetadataLogEntry>> getIndexMetadataLog(String indexName, boolean forceInit);
Optional<FlintMetadataLog<FlintMetadataLogEntry>> getIndexMetadataLog(String indexName, boolean initIfNotExist);

/**
* Get metadata log for index.
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 initIfNotExist) {
return metadataLogService.startTransaction(indexName, initIfNotExist);
public <T> OptimisticTransaction<T> startTransaction(String indexName, boolean forceInit) {
return metadataLogService.startTransaction(indexName, forceInit);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public <T> OptimisticTransaction<T> startTransaction(String indexName, boolean f
}

@Override
public Optional<FlintMetadataLog<FlintMetadataLogEntry>> getIndexMetadataLog(String indexName, boolean forceInit) {
public Optional<FlintMetadataLog<FlintMetadataLogEntry>> getIndexMetadataLog(String indexName, boolean initIfNotExist) {
LOG.info("Getting metadata log for index " + indexName + " and data source " + dataSourceName);
try (IRestHighLevelClient client = createOpenSearchClient()) {
if (client.doesIndexExist(new GetIndexRequest(metaLogIndexName), RequestOptions.DEFAULT)) {
LOG.info("Found metadata log index " + metaLogIndexName);
} else {
if (forceInit) {
if (initIfNotExist) {
initIndexMetadataLog();
} else {
String errorMsg = "Metadata log index not found " + metaLogIndexName;
Expand Down

0 comments on commit 6b86c11

Please sign in to comment.