From 5eacf13a47cfa2e043f7e5c40ebc5a094b6d4c47 Mon Sep 17 00:00:00 2001 From: yhmo Date: Wed, 26 Nov 2025 18:47:22 +0800 Subject: [PATCH] Add GetCompactionPlans interface, fix some small issues Signed-off-by: yhmo --- .../io/milvus/v2/client/MilvusClientV2.java | 10 +++ .../io/milvus/v2/common/CompactionPlan.java | 72 ++++++++++++++++++ .../milvus/v2/service/index/IndexService.java | 3 +- .../request/CreateResourceGroupReq.java | 19 +++++ .../request/DescribeResourceGroupReq.java | 19 +++++ .../request/DropResourceGroupReq.java | 19 +++++ .../request/ListResourceGroupsReq.java | 19 +++++ .../request/TransferNodeReq.java | 19 +++++ .../request/TransferReplicaReq.java | 21 ++++- .../request/UpdateResourceGroupsReq.java | 19 +++++ .../v2/service/utility/UtilityService.java | 32 ++++++++ .../request/GetCompactionPlansReq.java | 60 +++++++++++++++ .../request/GetPersistentSegmentInfoReq.java | 19 +++++ .../request/GetQuerySegmentInfoReq.java | 19 +++++ .../utility/response/CheckHealthResp.java | 19 +++++ .../response/GetCompactionPlansResp.java | 76 +++++++++++++++++++ .../GetPersistentSegmentInfoResp.java | 19 +++++ .../response/GetQuerySegmentInfoResp.java | 19 +++++ 18 files changed, 481 insertions(+), 2 deletions(-) create mode 100644 sdk-core/src/main/java/io/milvus/v2/common/CompactionPlan.java create mode 100644 sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetCompactionPlansReq.java create mode 100644 sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetCompactionPlansResp.java diff --git a/sdk-core/src/main/java/io/milvus/v2/client/MilvusClientV2.java b/sdk-core/src/main/java/io/milvus/v2/client/MilvusClientV2.java index 3e3beac1c..8ada2b41e 100644 --- a/sdk-core/src/main/java/io/milvus/v2/client/MilvusClientV2.java +++ b/sdk-core/src/main/java/io/milvus/v2/client/MilvusClientV2.java @@ -1122,6 +1122,16 @@ public GetCompactionStateResp getCompactionState(GetCompactionStateReq request) return rpcUtils.retry(() -> utilityService.getCompactionState(this.getRpcStub(), request)); } + /** + * get plans of a compact task by its ID + * + * @param request get compact plans request + * @return GetCompactPlansResp + */ + public GetCompactionPlansResp getCompactionPlans(GetCompactionPlansReq request) { + return rpcUtils.retry(() -> utilityService.getCompactionPlans(this.getRpcStub(), request)); + } + /** * Get server version * diff --git a/sdk-core/src/main/java/io/milvus/v2/common/CompactionPlan.java b/sdk-core/src/main/java/io/milvus/v2/common/CompactionPlan.java new file mode 100644 index 000000000..2447a3d1f --- /dev/null +++ b/sdk-core/src/main/java/io/milvus/v2/common/CompactionPlan.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package io.milvus.v2.common; + +import java.util.ArrayList; +import java.util.List; + +public class CompactionPlan { + private Long target; + private List sources; + + private CompactionPlan(CompactionPlanBuilder builder) { + this.target = builder.target; + this.sources = builder.sources; + } + + public static CompactionPlanBuilder builder() { + return new CompactionPlanBuilder(); + } + + public Long getTarget() { + return this.target; + } + + public List getSources() { + return this.sources; + } + + @Override + public String toString() { + return "CompactionPlan{" + + "target=" + target + + ", sources=" + sources + + '}'; + } + + public static class CompactionPlanBuilder { + private Long target = 0L; + private List sources = new ArrayList<>(); + + public CompactionPlanBuilder target(long target) { + this.target = target; + return this; + } + + public CompactionPlanBuilder sources(List sources) { + this.sources = sources; + return this; + } + + public CompactionPlan build() { + return new CompactionPlan(this); + } + } +} diff --git a/sdk-core/src/main/java/io/milvus/v2/service/index/IndexService.java b/sdk-core/src/main/java/io/milvus/v2/service/index/IndexService.java index bc34b0f54..5a498831c 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/index/IndexService.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/index/IndexService.java @@ -163,7 +163,8 @@ public DescribeIndexResp describeIndex(MilvusServiceGrpc.MilvusServiceBlockingSt DescribeIndexRequest.Builder builder = DescribeIndexRequest.newBuilder() .setCollectionName(collectionName) .setFieldName(fieldName == null ? "" : fieldName) - .setIndexName(indexName == null ? "" : indexName); + .setIndexName(indexName == null ? "" : indexName) + .setTimestamp(request.getTimestamp()); if (StringUtils.isNotEmpty(dbName)) { builder.setDbName(dbName); } diff --git a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/CreateResourceGroupReq.java b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/CreateResourceGroupReq.java index 0fe156c98..3d27f4f66 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/CreateResourceGroupReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/CreateResourceGroupReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.resourcegroup.request; import io.milvus.common.resourcegroup.ResourceGroupConfig; diff --git a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/DescribeResourceGroupReq.java b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/DescribeResourceGroupReq.java index d46dbd032..a72e9340c 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/DescribeResourceGroupReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/DescribeResourceGroupReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.resourcegroup.request; public class DescribeResourceGroupReq { diff --git a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/DropResourceGroupReq.java b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/DropResourceGroupReq.java index 315bde44d..bd6d41a54 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/DropResourceGroupReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/DropResourceGroupReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.resourcegroup.request; public class DropResourceGroupReq { diff --git a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/ListResourceGroupsReq.java b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/ListResourceGroupsReq.java index 20245d752..567bf3609 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/ListResourceGroupsReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/ListResourceGroupsReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.resourcegroup.request; public class ListResourceGroupsReq { diff --git a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/TransferNodeReq.java b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/TransferNodeReq.java index a59cde251..89791d786 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/TransferNodeReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/TransferNodeReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.resourcegroup.request; public class TransferNodeReq { diff --git a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/TransferReplicaReq.java b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/TransferReplicaReq.java index c24944120..d17a56de0 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/TransferReplicaReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/TransferReplicaReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.resourcegroup.request; public class TransferReplicaReq { @@ -75,7 +94,7 @@ public static class TransferReplicaReqBuilder { private String targetGroupName; private String collectionName; private String databaseName; - private Long numberOfReplicas; + private Long numberOfReplicas = 1L; public TransferReplicaReqBuilder sourceGroupName(String sourceGroupName) { this.sourceGroupName = sourceGroupName; diff --git a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/UpdateResourceGroupsReq.java b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/UpdateResourceGroupsReq.java index dcd57792c..eb08b9c8d 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/UpdateResourceGroupsReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/resourcegroup/request/UpdateResourceGroupsReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.resourcegroup.request; import io.milvus.common.resourcegroup.ResourceGroupConfig; diff --git a/sdk-core/src/main/java/io/milvus/v2/service/utility/UtilityService.java b/sdk-core/src/main/java/io/milvus/v2/service/utility/UtilityService.java index e016a8d4e..774aa39e1 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/utility/UtilityService.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/utility/UtilityService.java @@ -20,6 +20,7 @@ package io.milvus.v2.service.utility; import io.milvus.grpc.*; +import io.milvus.v2.common.CompactionPlan; import io.milvus.v2.common.CompactionState; import io.milvus.v2.exception.ErrorCode; import io.milvus.v2.exception.MilvusClientException; @@ -32,6 +33,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; public class UtilityService extends BaseService { @@ -81,6 +83,12 @@ public Void waitFlush(MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub, .build()); flushed = flushResponse.getFlushed(); + try { + TimeUnit.SECONDS.sleep(1); + } catch (InterruptedException t) { + System.out.println("Interrupted: " + t.getMessage()); + break; + } } } }); @@ -132,6 +140,30 @@ public GetCompactionStateResp getCompactionState(MilvusServiceGrpc.MilvusService .build(); } + public GetCompactionPlansResp getCompactionPlans(MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub, + GetCompactionPlansReq request) { + String title = "Get compaction plans"; + GetCompactionPlansRequest getRequest = GetCompactionPlansRequest.newBuilder() + .setCompactionID(request.getCompactionID()) + .build(); + GetCompactionPlansResponse response = blockingStub.getCompactionStateWithPlans(getRequest); + rpcUtils.handleResponse(title, response.getStatus()); + + List plans = new ArrayList<>(); + List infos = response.getMergeInfosList(); + infos.forEach(info -> { + plans.add(CompactionPlan.builder() + .target(info.getTarget()) + .sources(info.getSourcesList()) + .build()); + }); + + return GetCompactionPlansResp.builder() + .state(CompactionState.valueOf(response.getState().name())) + .plans(plans) + .build(); + } + public Void createAlias(MilvusServiceGrpc.MilvusServiceBlockingStub blockingStub, CreateAliasReq request) { String dbName = request.getDatabaseName(); String collectionName = request.getCollectionName(); diff --git a/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetCompactionPlansReq.java b/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetCompactionPlansReq.java new file mode 100644 index 000000000..5af2a9038 --- /dev/null +++ b/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetCompactionPlansReq.java @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package io.milvus.v2.service.utility.request; + +public class GetCompactionPlansReq { + private Long compactionID; + + private GetCompactionPlansReq(GetCompactionPlansReqBuilder builder) { + this.compactionID = builder.compactionID; + } + + public static GetCompactionPlansReqBuilder builder() { + return new GetCompactionPlansReqBuilder(); + } + + public Long getCompactionID() { + return compactionID; + } + + public void setCompactionID(Long compactionID) { + this.compactionID = compactionID; + } + + @Override + public String toString() { + return "GetCompactionPlansReq{" + + "compactionID=" + compactionID + + '}'; + } + + public static class GetCompactionPlansReqBuilder { + private Long compactionID; + + public GetCompactionPlansReqBuilder compactionID(Long compactionID) { + this.compactionID = compactionID; + return this; + } + + public GetCompactionPlansReq build() { + return new GetCompactionPlansReq(this); + } + } +} diff --git a/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetPersistentSegmentInfoReq.java b/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetPersistentSegmentInfoReq.java index f8820fcc0..abf5348a8 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetPersistentSegmentInfoReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetPersistentSegmentInfoReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.utility.request; public class GetPersistentSegmentInfoReq { diff --git a/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetQuerySegmentInfoReq.java b/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetQuerySegmentInfoReq.java index 0732185cf..efbc80853 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetQuerySegmentInfoReq.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/utility/request/GetQuerySegmentInfoReq.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.utility.request; public class GetQuerySegmentInfoReq { diff --git a/sdk-core/src/main/java/io/milvus/v2/service/utility/response/CheckHealthResp.java b/sdk-core/src/main/java/io/milvus/v2/service/utility/response/CheckHealthResp.java index 8cd67f83e..217d9594e 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/utility/response/CheckHealthResp.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/utility/response/CheckHealthResp.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.utility.response; import java.util.ArrayList; diff --git a/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetCompactionPlansResp.java b/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetCompactionPlansResp.java new file mode 100644 index 000000000..7f1bdce96 --- /dev/null +++ b/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetCompactionPlansResp.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package io.milvus.v2.service.utility.response; + +import io.milvus.v2.common.CompactionPlan; +import io.milvus.v2.common.CompactionState; + +import java.util.ArrayList; +import java.util.List; + +public class GetCompactionPlansResp { + private CompactionState state; + private List plans; + + private GetCompactionPlansResp(GetCompactionPlansRespBuilder builder) { + this.state = builder.state; + this.plans = builder.plans; + } + + public static GetCompactionPlansRespBuilder builder() { + return new GetCompactionPlansRespBuilder(); + } + + public CompactionState getState() { + return state; + } + + public List getPlans() { + return plans; + } + + + @Override + public String toString() { + return "GetCompactionPlansResp{" + + "state=" + state + + ", plans=" + plans + + '}'; + } + + public static class GetCompactionPlansRespBuilder { + private CompactionState state = CompactionState.UndefiedState; + private List plans = new ArrayList<>(); + + public GetCompactionPlansRespBuilder state(CompactionState state) { + this.state = state; + return this; + } + + public GetCompactionPlansRespBuilder plans(List plans) { + this.plans = plans; + return this; + } + + public GetCompactionPlansResp build() { + return new GetCompactionPlansResp(this); + } + } +} diff --git a/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetPersistentSegmentInfoResp.java b/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetPersistentSegmentInfoResp.java index e77f19836..ae6486a1e 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetPersistentSegmentInfoResp.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetPersistentSegmentInfoResp.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.utility.response; import java.util.ArrayList; diff --git a/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetQuerySegmentInfoResp.java b/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetQuerySegmentInfoResp.java index 06e8dc2d8..be91c3246 100644 --- a/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetQuerySegmentInfoResp.java +++ b/sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetQuerySegmentInfoResp.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.milvus.v2.service.utility.response; import java.util.ArrayList;