forked from apache/druid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:apache/druid into refactor_segmen…
…t_iterator
- Loading branch information
Showing
97 changed files
with
3,891 additions
and
2,296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
...n/java/org/apache/druid/indexing/common/actions/RetrieveUpgradedFromSegmentIdsAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* 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.indexing.common.actions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import org.apache.druid.indexing.common.task.Task; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* Task action to retrieve the segment IDs from which a given set of segments were upgraded. | ||
*/ | ||
public class RetrieveUpgradedFromSegmentIdsAction implements TaskAction<UpgradedFromSegmentsResponse> | ||
{ | ||
private final String dataSource; | ||
private final Set<String> segmentIds; | ||
|
||
@JsonCreator | ||
public RetrieveUpgradedFromSegmentIdsAction( | ||
@JsonProperty("dataSource") String dataSource, | ||
@JsonProperty("segmentIds") Set<String> segmentIds | ||
) | ||
{ | ||
this.dataSource = dataSource; | ||
this.segmentIds = segmentIds; | ||
} | ||
|
||
@JsonProperty | ||
public String getDataSource() | ||
{ | ||
return dataSource; | ||
} | ||
|
||
@JsonProperty | ||
public Set<String> getSegmentIds() | ||
{ | ||
return segmentIds; | ||
} | ||
|
||
@Override | ||
public TypeReference<UpgradedFromSegmentsResponse> getReturnTypeReference() | ||
{ | ||
return new TypeReference<UpgradedFromSegmentsResponse>() | ||
{ | ||
}; | ||
} | ||
|
||
@Override | ||
public UpgradedFromSegmentsResponse perform(Task task, TaskActionToolbox toolbox) | ||
{ | ||
return new UpgradedFromSegmentsResponse( | ||
toolbox.getIndexerMetadataStorageCoordinator() | ||
.retrieveUpgradedFromSegmentIds(dataSource, segmentIds) | ||
); | ||
} | ||
|
||
@Override | ||
public boolean isAudited() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return getClass().getSimpleName() + "{" + | ||
"dataSource='" + dataSource + '\'' + | ||
", segmentIds=" + segmentIds + | ||
'}'; | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
...ain/java/org/apache/druid/indexing/common/actions/RetrieveUpgradedToSegmentIdsAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
* 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.indexing.common.actions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import org.apache.druid.indexing.common.task.Task; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* Task action to determine the set of all segments containing the same load spec given the parent id. <br/> | ||
* Returns a map from a segment ID to a set containing: | ||
* <ol> | ||
* <li> all segment IDs that were upgraded from it AND are still present in the metadata store </li> | ||
* <li> the segment ID itself if and only if it is still present in the metadata store </li> | ||
* </ol> | ||
*/ | ||
public class RetrieveUpgradedToSegmentIdsAction implements TaskAction<UpgradedToSegmentsResponse> | ||
{ | ||
private final String dataSource; | ||
private final Set<String> segmentIds; | ||
|
||
@JsonCreator | ||
public RetrieveUpgradedToSegmentIdsAction( | ||
@JsonProperty("dataSource") String dataSource, | ||
@JsonProperty("segmentIds") Set<String> segmentIds | ||
) | ||
{ | ||
this.dataSource = dataSource; | ||
this.segmentIds = segmentIds; | ||
} | ||
|
||
@JsonProperty | ||
public String getDataSource() | ||
{ | ||
return dataSource; | ||
} | ||
|
||
@JsonProperty | ||
public Set<String> getSegmentIds() | ||
{ | ||
return segmentIds; | ||
} | ||
|
||
@Override | ||
public TypeReference<UpgradedToSegmentsResponse> getReturnTypeReference() | ||
{ | ||
return new TypeReference<UpgradedToSegmentsResponse>() | ||
{ | ||
}; | ||
} | ||
|
||
@Override | ||
public UpgradedToSegmentsResponse perform(Task task, TaskActionToolbox toolbox) | ||
{ | ||
return new UpgradedToSegmentsResponse( | ||
toolbox.getIndexerMetadataStorageCoordinator() | ||
.retrieveUpgradedToSegmentIds(dataSource, segmentIds) | ||
); | ||
} | ||
|
||
@Override | ||
public boolean isAudited() | ||
{ | ||
return false; | ||
} | ||
|
||
@Override | ||
public String toString() | ||
{ | ||
return getClass().getSimpleName() + "{" + | ||
"dataSource='" + dataSource + '\'' + | ||
", segmentIds=" + segmentIds + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
.../src/main/java/org/apache/druid/indexing/common/actions/UpgradedFromSegmentsResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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.indexing.common.actions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.Map; | ||
|
||
public class UpgradedFromSegmentsResponse | ||
{ | ||
private final Map<String, String> upgradedFromSegmentIds; | ||
|
||
@JsonCreator | ||
public UpgradedFromSegmentsResponse( | ||
@JsonProperty("upgradedFromSegmentIds") Map<String, String> upgradedFromSegmentIds | ||
) | ||
{ | ||
this.upgradedFromSegmentIds = upgradedFromSegmentIds; | ||
} | ||
|
||
@JsonProperty | ||
public Map<String, String> getUpgradedFromSegmentIds() | ||
{ | ||
return upgradedFromSegmentIds; | ||
} | ||
} |
Oops, something went wrong.