Skip to content

Commit eecb071

Browse files
committed
Moved View and ViewMetadata to server
1 parent 7484177 commit eecb071

File tree

15 files changed

+33
-13
lines changed

15 files changed

+33
-13
lines changed

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/view/View.java renamed to server/src/main/java/org/elasticsearch/cluster/metadata/View.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
7-
package org.elasticsearch.xpack.esql.view;
9+
package org.elasticsearch.cluster.metadata;
810

911
import org.elasticsearch.common.Strings;
1012
import org.elasticsearch.common.io.stream.StreamInput;
@@ -39,7 +41,7 @@ public final class View implements Writeable, ToXContentFragment {
3941
}
4042

4143
// Parser that excludes the name field (eg. when the name is provided externally, in the URL path)
42-
static ConstructingObjectParser<View, Void> parser(String name) {
44+
public static ConstructingObjectParser<View, Void> parser(String name) {
4345
ConstructingObjectParser<View, Void> parser = new ConstructingObjectParser<>(
4446
"view",
4547
false,
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
/*
22
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3-
* or more contributor license agreements. Licensed under the Elastic License
4-
* 2.0; you may not use this file except in compliance with the Elastic License
5-
* 2.0.
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
68
*/
7-
package org.elasticsearch.xpack.esql.view;
9+
package org.elasticsearch.cluster.metadata;
810

911
import org.elasticsearch.TransportVersion;
1012
import org.elasticsearch.cluster.AbstractNamedDiffable;
1113
import org.elasticsearch.cluster.NamedDiff;
12-
import org.elasticsearch.cluster.metadata.Metadata;
1314
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
1415
import org.elasticsearch.common.io.stream.StreamInput;
1516
import org.elasticsearch.common.io.stream.StreamOutput;
@@ -116,10 +117,10 @@ public Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params ignore
116117
return ChunkedToXContentHelper.array(VIEWS.getPreferredName(), new ViewIterator(views));
117118
}
118119

119-
static class ViewIterator implements Iterator<ToXContent> {
120+
public static class ViewIterator implements Iterator<ToXContent> {
120121
private final Iterator<View> internal;
121122

122-
ViewIterator(List<View> views) {
123+
public ViewIterator(List<View> views) {
123124
this.internal = views.iterator();
124125
}
125126

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/plugin/EsqlPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
1010
import org.elasticsearch.cluster.metadata.Metadata;
11+
import org.elasticsearch.cluster.metadata.ViewMetadata;
1112
import org.elasticsearch.cluster.node.DiscoveryNodes;
1213
import org.elasticsearch.common.breaker.CircuitBreaker;
1314
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
@@ -94,7 +95,6 @@
9495
import org.elasticsearch.xpack.esql.view.TransportDeleteViewAction;
9596
import org.elasticsearch.xpack.esql.view.TransportGetViewAction;
9697
import org.elasticsearch.xpack.esql.view.TransportPutViewAction;
97-
import org.elasticsearch.xpack.esql.view.ViewMetadata;
9898
import org.elasticsearch.xpack.esql.view.ViewService;
9999

100100
import java.util.ArrayList;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/view/ClusterViewService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import org.elasticsearch.cluster.SequentialAckingBatchedTaskExecutor;
1717
import org.elasticsearch.cluster.metadata.ProjectId;
1818
import org.elasticsearch.cluster.metadata.ProjectMetadata;
19+
import org.elasticsearch.cluster.metadata.View;
20+
import org.elasticsearch.cluster.metadata.ViewMetadata;
1921
import org.elasticsearch.cluster.project.ProjectResolver;
2022
import org.elasticsearch.cluster.service.ClusterService;
2123
import org.elasticsearch.cluster.service.MasterServiceTaskQueue;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/view/GetViewAction.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import org.elasticsearch.action.ActionType;
1111
import org.elasticsearch.action.support.TransportAction;
1212
import org.elasticsearch.action.support.local.LocalClusterStateRequest;
13+
import org.elasticsearch.cluster.metadata.View;
14+
import org.elasticsearch.cluster.metadata.ViewMetadata;
1315
import org.elasticsearch.common.io.stream.StreamInput;
1416
import org.elasticsearch.common.io.stream.StreamOutput;
1517
import org.elasticsearch.common.xcontent.ChunkedToXContentHelper;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/view/PutViewAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import org.elasticsearch.action.ActionType;
1010
import org.elasticsearch.action.support.master.AcknowledgedRequest;
1111
import org.elasticsearch.action.support.master.AcknowledgedResponse;
12+
import org.elasticsearch.cluster.metadata.View;
1213
import org.elasticsearch.common.io.stream.StreamInput;
1314
import org.elasticsearch.common.io.stream.StreamOutput;
1415
import org.elasticsearch.core.TimeValue;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/view/RestPutViewAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package org.elasticsearch.xpack.esql.view;
99

1010
import org.elasticsearch.client.internal.node.NodeClient;
11+
import org.elasticsearch.cluster.metadata.View;
1112
import org.elasticsearch.rest.BaseRestHandler;
1213
import org.elasticsearch.rest.RestRequest;
1314
import org.elasticsearch.rest.RestUtils;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/view/TransportGetViewAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.elasticsearch.cluster.block.ClusterBlockException;
1717
import org.elasticsearch.cluster.block.ClusterBlockLevel;
1818
import org.elasticsearch.cluster.metadata.ProjectId;
19+
import org.elasticsearch.cluster.metadata.View;
1920
import org.elasticsearch.cluster.project.ProjectResolver;
2021
import org.elasticsearch.cluster.service.ClusterService;
2122
import org.elasticsearch.common.util.concurrent.EsExecutors;

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/view/ViewService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import org.elasticsearch.action.support.master.AcknowledgedResponse;
1414
import org.elasticsearch.cluster.metadata.MetadataCreateIndexService;
1515
import org.elasticsearch.cluster.metadata.ProjectId;
16+
import org.elasticsearch.cluster.metadata.View;
17+
import org.elasticsearch.cluster.metadata.ViewMetadata;
1618
import org.elasticsearch.common.Strings;
1719
import org.elasticsearch.common.settings.Settings;
1820
import org.elasticsearch.xpack.esql.VerificationException;

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/view/AbstractViewTestCase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.elasticsearch.action.support.master.AcknowledgedResponse;
1111
import org.elasticsearch.cluster.ProjectState;
1212
import org.elasticsearch.cluster.metadata.ProjectId;
13+
import org.elasticsearch.cluster.metadata.View;
1314
import org.elasticsearch.cluster.project.ProjectResolver;
1415
import org.elasticsearch.cluster.service.ClusterService;
1516
import org.elasticsearch.core.TimeValue;

0 commit comments

Comments
 (0)