Skip to content

[Transform] Wait while index is blocked #119542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[CI] Auto commit changes from spotless
  • Loading branch information
elasticsearchmachine committed Jan 3, 2025
commit 95284ed3ee7f6b8672ee0ce9c7f02b06d46d4c24
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ private void createContinuousTransform(String indexName, String transformId, Str
.addAggregator(AggregationBuilders.avg("review_score").field("stars"))
.addAggregator(AggregationBuilders.max("timestamp").field("timestamp"));

var config = createTransformConfigBuilder(transformId, destinationIndex, QueryConfig.matchAll(), indexName)
.setPivotConfig(createPivotConfig(groups, aggs))
var config = createTransformConfigBuilder(transformId, destinationIndex, QueryConfig.matchAll(), indexName).setPivotConfig(
createPivotConfig(groups, aggs)
)
.setSyncConfig(new TimeSyncConfig("timestamp", TimeValue.timeValueSeconds(1)))
.setSettings(new SettingsConfig.Builder().setAlignCheckpoints(false).build())
.build();
Expand Down Expand Up @@ -691,11 +692,11 @@ private void indexMoreDocs(long timestamp, long userId, String index) throws Exc
private void indexDoc(long userId, String index) throws Exception {
StringBuilder bulkBuilder = new StringBuilder();
bulkBuilder.append(format("""
{"create":{"_index":"%s"}}
""", index));
{"create":{"_index":"%s"}}
""", index));
String source = format("""
{"user_id":"user_%s","count":%s,"business_id":"business_%s","stars":%s,"timestamp":%s}
""", userId, 1, 2, 5, Instant.now().toEpochMilli());
{"user_id":"user_%s","count":%s,"business_id":"business_%s","stars":%s,"timestamp":%s}
""", userId, 1, 2, 5, Instant.now().toEpochMilli());
bulkBuilder.append(source);
bulkBuilder.append("\r\n");
doBulk(bulkBuilder.toString(), true);
Expand Down