egor-ryashin commented on a change in pull request #7306: Reconcile terminology 
and method naming to 'used/unused segments'; Rename MetadataSegmentManager to 
MetadataSegments
URL: https://github.com/apache/incubator-druid/pull/7306#discussion_r309322485
 
 

 ##########
 File path: server/src/main/java/org/apache/druid/metadata/MetadataSegments.java
 ##########
 @@ -0,0 +1,121 @@
+/*
+ * 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 org.apache.druid.metadata;
+
+import com.google.common.annotations.VisibleForTesting;
+import org.apache.druid.client.DruidDataSource;
+import org.apache.druid.client.ImmutableDruidDataSource;
+import org.apache.druid.timeline.DataSegment;
+import org.apache.druid.timeline.SegmentId;
+import org.joda.time.Interval;
+
+import javax.annotation.Nullable;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ */
+public interface MetadataSegments
+{
+  void start();
+
+  void stop();
+
+  boolean tryMarkAsUsedAllSegmentsInDataSource(String dataSource);
+
+  boolean tryMarkSegmentAsUsed(String segmentId);
+
+  boolean tryMarkAsUnusedAllSegmentsInDataSource(String dataSource);
+
+  /**
+   * Prefer {@link #tryMarkSegmentAsUnused(SegmentId)} to this method when 
possible.
+   *
+   * This method is not removed because {@link 
org.apache.druid.server.http.DataSourcesResource#removeSegment}
+   * uses it and if it migrates to {@link #tryMarkSegmentAsUnused(SegmentId)} 
the performance will be worse.
+   */
+  boolean tryMarkSegmentAsUnused(String dataSource, String segmentId);
 
 Review comment:
   This question is missed, I guess.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to