-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2c254c
commit 6c45be9
Showing
41 changed files
with
441 additions
and
217 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
105 changes: 105 additions & 0 deletions
105
circus-train-api/src/main/java/com/hotels/bdp/circustrain/api/copier/CopierContext.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,105 @@ | ||
/** | ||
* Copyright (C) 2016-2020 Expedia, Inc. | ||
* | ||
* Licensed 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 com.hotels.bdp.circustrain.api.copier; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.apache.hadoop.fs.Path; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import com.google.common.collect.ImmutableMap; | ||
|
||
import com.hotels.bdp.circustrain.api.conf.TableReplication; | ||
|
||
public final class CopierContext { | ||
|
||
private String eventId; | ||
private Path sourceBaseLocation; | ||
private List<Path> sourceSubLocations = ImmutableList.copyOf(Collections.<Path>emptyList()); | ||
private Path replicaLocation; | ||
private Map<String, Object> copierOptions; | ||
private TableReplication tableReplication; | ||
|
||
public CopierContext( | ||
TableReplication tableReplication, | ||
String eventId, | ||
Path sourceBaseLocation, | ||
List<Path> sourceSubLocations, | ||
Path replicaLocation, | ||
Map<String, Object> copierOptions) { | ||
this.tableReplication = tableReplication; | ||
this.eventId = eventId; | ||
this.sourceBaseLocation = sourceBaseLocation; | ||
if (sourceSubLocations != null) { | ||
this.sourceSubLocations = ImmutableList.copyOf(sourceSubLocations); | ||
} | ||
this.replicaLocation = replicaLocation; | ||
this.copierOptions = ImmutableMap.copyOf(copierOptions); | ||
} | ||
|
||
public CopierContext( | ||
TableReplication tableReplication, | ||
String eventId, | ||
Path sourceLocation, | ||
Path replicaLocation, | ||
Map<String, Object> copierOptions) { | ||
this(tableReplication, eventId, sourceLocation, null, replicaLocation, copierOptions); | ||
} | ||
|
||
public CopierContext( | ||
String eventId, | ||
Path sourceBaseLocation, | ||
List<Path> sourceSubLocations, | ||
Path replicaLocation, | ||
Map<String, Object> copierOptions) { | ||
this(null, eventId, sourceBaseLocation, sourceSubLocations, replicaLocation, copierOptions); | ||
} | ||
|
||
public CopierContext( | ||
String eventId, | ||
Path sourceBaseLocation, | ||
Path replicaLocation, | ||
Map<String, Object> copierOptions) { | ||
this(null, eventId, sourceBaseLocation, null, replicaLocation, copierOptions); | ||
} | ||
|
||
public String getEventId() { | ||
return eventId; | ||
} | ||
|
||
public Path getSourceBaseLocation() { | ||
return sourceBaseLocation; | ||
} | ||
|
||
public List<Path> getSourceSubLocations() { | ||
return sourceSubLocations; | ||
} | ||
|
||
public Path getReplicaLocation() { | ||
return replicaLocation; | ||
} | ||
|
||
public Map<String, Object> getCopierOptions() { | ||
return copierOptions; | ||
} | ||
|
||
public TableReplication getTableReplication() { | ||
return tableReplication; | ||
} | ||
|
||
} |
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
2 changes: 1 addition & 1 deletion
2
...in-api/src/main/java/com/hotels/bdp/circustrain/api/copier/CopierPathGeneratorParams.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
Oops, something went wrong.