forked from apache/asterixdb
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ASTERIXDB-3144][RT] Introduce DataPartitioningProvider
- user model changes: no - storage format changes: no - interface changes: yes Details: - Add storage partitioning scheme config (dyanmic or static) and default it to dynamic. - Introduce DataPartitioningProvider which encapsulates the logic for dataset partitioning based on the partitioning scheme. Change-Id: Ia2bbc716fb4c2e9abca06e8f8629b15bd48bc7f3 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17503 Reviewed-by: Murtadha Hubail <mhubail@apache.org> Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com> Tested-by: Murtadha Hubail <mhubail@apache.org>
- Loading branch information
Showing
24 changed files
with
483 additions
and
265 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
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
56 changes: 56 additions & 0 deletions
56
...sterix-common/src/main/java/org/apache/asterix/common/cluster/PartitioningProperties.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,56 @@ | ||
/* | ||
* 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.asterix.common.cluster; | ||
|
||
import org.apache.hyracks.algebricks.common.constraints.AlgebricksPartitionConstraint; | ||
import org.apache.hyracks.dataflow.std.file.IFileSplitProvider; | ||
|
||
public class PartitioningProperties { | ||
private final IFileSplitProvider splitsProvider; | ||
private final AlgebricksPartitionConstraint constraints; | ||
private final int[][] computeStorageMap; | ||
|
||
private PartitioningProperties(IFileSplitProvider splitsProvider, AlgebricksPartitionConstraint constraints, | ||
int[][] computeStorageMap) { | ||
this.splitsProvider = splitsProvider; | ||
this.constraints = constraints; | ||
this.computeStorageMap = computeStorageMap; | ||
} | ||
|
||
public static PartitioningProperties of(IFileSplitProvider splitsProvider, | ||
AlgebricksPartitionConstraint constraints, int[][] computeStorageMap) { | ||
return new PartitioningProperties(splitsProvider, constraints, computeStorageMap); | ||
} | ||
|
||
public IFileSplitProvider getSpiltsProvider() { | ||
return splitsProvider; | ||
} | ||
|
||
public AlgebricksPartitionConstraint getConstraints() { | ||
return constraints; | ||
} | ||
|
||
public int[][] getComputeStorageMap() { | ||
return computeStorageMap; | ||
} | ||
|
||
public int getNumberOfPartitions() { | ||
return splitsProvider.getFileSplits().length; | ||
} | ||
} |
Oops, something went wrong.