id int64 0 1.29M | original_id stringlengths 32 32 | swhid stringlengths 100 170 | sha1 stringlengths 40 40 | repo_name stringlengths 2 45 | repo_group stringclasses 12
values | filepath stringlengths 5 153 | name stringlengths 1 14.9k | type stringclasses 3
values | code stringlengths 7 2.12M |
|---|---|---|---|---|---|---|---|---|---|
2,300 | 5efa4bb3a4de76045f8c79f5b523e6cd | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=309-316/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::publishData(WorkUnitState state) | function | @Override
public void publishData(WorkUnitState state)
throws IOException {
for (int branchId = 0; branchId < this.numBranches; branchId++) {
publishSingleTaskData(state, branchId);
}
this.parallelRunnerCloser.close();
} |
2,301 | 825ac29ec065720dce4660ae93574786 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=345-353/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::publishMultiTaskData(WorkUnitState state, int branchId, Set<Path> writerOutputPathsMoved) | function | /**
* This method publishes task output data for the given {@link WorkUnitState}, but if there are output data of
* other tasks in the same folder, it may also publish those data.
*/
protected void publishMultiTaskData(WorkUnitState state, int branchId, Set<Path> writerOutputPathsMoved)
t... |
2,302 | da699aa5f84c391e5024a4991347f828 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=508-550/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::publishMetadata(Collection<? extends WorkUnitState> states) | function | /**
* Merge all of the metadata output from each work-unit and publish the merged record.
* @param states States from all tasks
* @throws IOException If there is an error publishing the file
*/
@Override
public void publishMetadata(Collection<? extends WorkUnitState> states)
thro... |
2,303 | 0916560734900cf49fb800b4a2ce7005 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=622-630/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::publishMetadata(WorkUnitState state) | function | /**
* Publish metadata for each branch. We expect the metadata to be of String format and
* populated in either the WRITER_MERGED_METADATA_KEY state or the WRITER_METADATA_KEY configuration key.
*/
@Override
public void publishMetadata(WorkUnitState state)
throws IOException {
... |
2,304 | bff69f2221a2ee6f22ecbe332b7cff30 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=255-259/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::initialize() | function | @Override
public void initialize()
throws IOException {
// Nothing needs to be done since the constructor already initializes the publisher.
} |
2,305 | 0ef91889658223bd52ccba190b2875a2 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=461-477/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::addWriterOutputToExistingDir(Path writerOutputDir, Path publisherOutputDir,
WorkUnitState workUnitState, int branchId, ParallelRunner parallelRunner) | function | protected void addWriterOutputToExistingDir(Path writerOutputDir, Path publisherOutputDir,
WorkUnitState workUnitState, int branchId, ParallelRunner parallelRunner)
throws IOException {
boolean preserveFileName = workUnitState.getPropAsBoolean(ForkOper... |
2,306 | e82ee6ba3196edbb1ec54385fbb77341 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=488-497/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::recordPublisherOutputDirs(Path src, Path dst, int branchId) | function | protected Collection<Path> recordPublisherOutputDirs(Path src, Path dst, int branchId)
throws IOException {
// Getting file status from src rather than dst, because at this time dst doesn't yet exist.
// If src is a dir, add dst to the set of paths. Otherwise, add dst's parent.
if (... |
2,307 | 1daab4f968f57650da2facea11733a8d | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=722-740/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::getMergedMetadataForPartitionAndBranch(String partitionId, int branchId) | function | /*
* Get the merged metadata given a workunit state and branch id. This method assumes
* all intermediate metadata has already been passed to the MetadataMerger.
*
* If metadata mergers are not configured, instead return the metadata from job config that was
* passed in by the user.
*/
... |
2,308 | 27634efe28b67035d86aacbcf06e2692 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=755-762/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::shouldPublishMetadataFirst() | function | /**
* The BaseDataPublisher relies on publishData() to create and clean-up the output directories, so data
* has to be published before the metadata can be.
*/
@Override
protected boolean shouldPublishMetadataFirst() {
return false;
} |
2,309 | c54e709b046cd4ae28f52a098a73746f | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=261-272/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::close() | function | @Override
public void close()
throws IOException {
try {
for (Path path : this.publisherOutputDirs) {
this.state.appendToSetProp(ConfigurationKeys.PUBLISHER_DIRS, path.toString());
}
this.state.setProp(ConfigurationKeys.PUBLISHER_LATEST_FILE_AR... |
2,310 | c1465d497bce3db7298da04b9575bf25 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=479-486/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::movePath(ParallelRunner parallelRunner, State state, Path src, Path dst, int branchId) | function | protected void movePath(ParallelRunner parallelRunner, State state, Path src, Path dst, int branchId)
throws IOException {
LOG.info(String.format("Moving %s to %s", src, dst));
boolean overwrite = state.getPropAsBoolean(ConfigurationKeys.DATA_PUBLISHER_OVERWRITE_ENABLED, false);
this... |
2,311 | bf1f98737b3cd4bd97c97d66143ff398 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=499-506/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::getParallelRunner(FileSystem fs) | function | private ParallelRunner getParallelRunner(FileSystem fs) {
String uri = fs.getUri().toString();
if (!this.parallelRunners.containsKey(uri)) {
this.parallelRunners
.put(uri, this.parallelRunnerCloser.register(new ParallelRunner(this.parallelRunnerThreads, fs)));
}
... |
2,312 | 5526ed83b83f6b5021360668ebc6e27f | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=237-253/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::loadExistingMetadata(Path metadataFilename, int branchId) | function | /**
* Read in existing metadata as a UTF8 string.
*/
private String loadExistingMetadata(Path metadataFilename, int branchId) {
try {
FileSystem fsForBranch = writerFileSystemByBranches.get(branchId);
if (!fsForBranch.exists(metadataFilename)) {
return null;... |
2,313 | 29b0ee1ee28c5acf0bd1028bab54bf26 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=714-720/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::getIntermediateMetadataFromState(WorkUnitState state, int branchId) | function | /*
* Retrieve intermediate metadata (eg the metadata stored by each writer) for a given state and branch id.
*/
private String getIntermediateMetadataFromState(WorkUnitState state, int branchId) {
return state.getProp(
ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WR... |
2,314 | 0b2ac376e14928b8b318ca19497ea5c4 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=297-307/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::createDestinationDescriptor(WorkUnitState state, int branchId) | function | /**
* Create destination dataset descriptor
*/
protected DatasetDescriptor createDestinationDescriptor(WorkUnitState state, int branchId) {
Path publisherOutputDir = getPublisherOutputDir(state, branchId);
FileSystem fs = this.publisherFileSystemByBranches.get(branchId);
DatasetDes... |
2,315 | 179b58c639fcd56a2c18a3a1a0f711e4 | swh:1:cnt:589553eab4ce672cf26b019335747b1326ad3771;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=274-295/ | c49887d27e71adb74c00fe5a975867bfdead4349 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/BaseDataPublisher.java | BaseDataPublisher::addLineageInfo(WorkUnitState state, int branchId) | function | private void addLineageInfo(WorkUnitState state, int branchId) {
if (!this.lineageInfo.isPresent()) {
LOG.info("Will not add lineage info");
return;
}
// Final dataset descriptor
DatasetDescriptor datasetDescriptor = createDestinationDescriptor(state, branchId);
... |
2,316 | bed408ed4e804b4da27fb5811dd3a334 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=87-922/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource | type | @SuppressForbidden
@SuppressFBWarnings(justification = "Class copied from upstream Gobblin")
public abstract class KafkaSource<S, D> extends EventBasedSource<S, D> {
private static final Logger LOG = LoggerFactory.getLogger(KafkaSource.class);
public static final String TOPIC_BLACKLIST = "topic.blacklist";
... |
2,317 | 2b66d4ac92839119b65240ee87fe61c8 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=815-879/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::Offsets | type | /**
* This class contains startOffset, earliestOffset and latestOffset for a Kafka partition.
*/
@SuppressForbidden
private static class Offsets {
@Getter
private long startOffset = 0;
@Getter
@Setter
private long earliestOffset = 0;
@Getter
@... |
2,318 | db5f3cf0c5ee3cde5b7aac1faaed5c31 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=881-921/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::WorkUnitCreator | type | private class WorkUnitCreator implements Runnable {
public static final String WORK_UNITS_FOR_TOPIC_TIMER = "workUnitsForTopicTimer";
private final KafkaTopic topic;
private final SourceState state;
private final Optional<State> topicSpecificState;
private final Map<String, List<... |
2,319 | f43c15bd8a4730b2d9840621ca9640f0 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=621-631/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getPreviousOffsetForPartition(KafkaPartition partition, SourceState state) | function | private long getPreviousOffsetForPartition(KafkaPartition partition, SourceState state)
throws PreviousOffsetNotFoundException {
getAllPreviousOffsetState(state);
if (this.previousOffsets.containsKey(partition)) {
return this.previousOffsets.get(partition);
}
th... |
2,320 | d92f7ceab92401d366dc2ceb250d7d4e | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=808-813/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::shutdown(SourceState state) | function | @Override
public void shutdown(SourceState state) {
state.setProp(ConfigurationKeys.OFFSET_TOO_EARLY_COUNT, this.offsetTooEarlyCount);
state.setProp(ConfigurationKeys.OFFSET_TOO_LATE_COUNT, this.offsetTooLateCount);
state.setProp(ConfigurationKeys.FAIL_TO_GET_OFFSET_COUNT, this.failToGetOffs... |
2,321 | 6dfe4ad14ae13861eded5d767acc98bd | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=633-644/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getPreviousExpectedHighWatermark(KafkaPartition partition, SourceState state) | function | private long getPreviousExpectedHighWatermark(KafkaPartition partition, SourceState state)
throws PreviousOffsetNotFoundException {
getAllPreviousOffsetState(state);
if (this.previousExpectedHighWatermarks.containsKey(partition)) {
return this.previousExpectedHighWatermarks.get... |
2,322 | 7415ddebb69ece9987cfe5fd5bf72e2f | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=659-717/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getAllPreviousOffsetState(SourceState state) | function | // need to be synchronized as this.previousOffsets, this.previousExpectedHighWatermarks, and
// this.previousOffsetFetchEpochTimes need to be initialized once
private synchronized void getAllPreviousOffsetState(SourceState state) {
if (this.doneGettingAllPreviousOffsets) {
return;
}
... |
2,323 | 7191b28b0f5ff0657bc83114a0ccb3bf | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=646-657/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getPreviousLowWatermark(KafkaPartition partition, SourceState state) | function | private long getPreviousLowWatermark(KafkaPartition partition, SourceState state)
throws PreviousOffsetNotFoundException {
getAllPreviousOffsetState(state);
if (this.previousLowWatermarks.containsKey(partition)) {
return this.previousLowWatermarks.get(partition);
}
... |
2,324 | 03b4b293371d0ee311d05036d9d1574a | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=323-329/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::addTopicSpecificPropsToWorkUnits(Map<String, List<WorkUnit>> workUnits, Map<String, State> topicSpecificStateMap) | function | private void addTopicSpecificPropsToWorkUnits(Map<String, List<WorkUnit>> workUnits, Map<String, State> topicSpecificStateMap) {
for (List<WorkUnit> workUnitList : workUnits.values()) {
for (WorkUnit workUnit : workUnitList) {
addTopicSpecificPropsToWorkUnit(workUnit, topicSpecificSt... |
2,325 | 7df807ee3c307b0d6be995f219c289ac | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=350-355/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::addDatasetUrnOptionally(WorkUnit workUnit) | function | private void addDatasetUrnOptionally(WorkUnit workUnit) {
if (!this.shouldEnableDatasetStateStore) {
return;
}
workUnit.setProp(ConfigurationKeys.DATASET_URN_KEY, workUnit.getProp(TOPIC_NAME));
} |
2,326 | 701745ae39583c8ebc812663ac045c7f | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=572-593/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::addSourceStatePropsToWorkUnit(WorkUnit workUnit, SourceState state) | function | /**
* A method to copy specific properties from the {@link SourceState} object to {@link WorkUnitState}.
* @param workUnit WorkUnit state
* @param state Source state
*/
private void addSourceStatePropsToWorkUnit(WorkUnit workUnit, SourceState state) {
//Copy the SLA config from SourceSta... |
2,327 | 569d7a7367d13f87384c77341ecf8b0b | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=799-806/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getFilteredTopics(SourceState state) | function | /**
* Return topics to be processed filtered by job-level whitelist and blacklist.
*/
protected List<KafkaTopic> getFilteredTopics(SourceState state) {
List<Pattern> blacklist = DatasetFilterUtils.getPatternList(state, TOPIC_BLACKLIST);
List<Pattern> whitelist = DatasetFilterUtils.getPatte... |
2,328 | e2b351e5ed14e77b823478ac82742336 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=331-348/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::addTopicSpecificPropsToWorkUnit(WorkUnit workUnit, Map<String, State> topicSpecificStateMap) | function | private void addTopicSpecificPropsToWorkUnit(WorkUnit workUnit, Map<String, State> topicSpecificStateMap) {
if (workUnit instanceof MultiWorkUnit) {
for (WorkUnit wu : ((MultiWorkUnit) workUnit).getWorkUnits()) {
addTopicSpecificPropsToWorkUnit(wu, topicSpecificStateMap);
... |
2,329 | 5b51a47cbf438648b2006718963ab67e | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=357-383/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::createEmptyWorkUnitsForSkippedPartitions(Map<String, List<WorkUnit>> workUnits,
Map<String, State> topicSpecificStateMap, SourceState state) | function | private void createEmptyWorkUnitsForSkippedPartitions(Map<String, List<WorkUnit>> workUnits,
Map<String, State> topicSpecificStateMap, SourceState state) {
// in case the previous offset not been set
getAllPreviousOffsetState(state);
//... |
2,330 | f30568152b1c656965bc57b87e46741c | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=595-599/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getPreviousStartFetchEpochTimeForPartition(KafkaPartition partition, SourceState state) | function | private long getPreviousStartFetchEpochTimeForPartition(KafkaPartition partition, SourceState state) {
getAllPreviousOffsetState(state);
return this.previousStartFetchEpochTimes.containsKey(partition) ?
this.previousStartFetchEpochTimes.get(partition) : 0;
} |
2,331 | f334d164a824145bb16dc45b0ff81c8d | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=876-878/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::Offsets::startAtLatestOffset() | function | private void startAtLatestOffset() {
this.startOffset = this.latestOffset;
} |
2,332 | 037b379877601a48f44eb72ca0487fe8 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=735-744/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::createEmptyWorkUnit(KafkaPartition partition, long previousOffset, long previousFetchEpochTime,
Optional<State> topicSpecificState) | function | // thread safe
private WorkUnit createEmptyWorkUnit(KafkaPartition partition, long previousOffset, long previousFetchEpochTime,
Optional<State> topicSpecificState) {
Offsets offsets = new Offsets();
offsets.setEarliestOffset(previousOffset);
offsets.s... |
2,333 | 3bf738e330dc981a9cb19d2113533028 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=746-797/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getWorkUnitForTopicPartition(KafkaPartition partition, Offsets offsets,
Optional<State> topicSpecificState) | function | private WorkUnit getWorkUnitForTopicPartition(KafkaPartition partition, Offsets offsets,
Optional<State> topicSpecificState) {
// Default to job level configurations
Extract.TableType currentTableType = tableType;
String currentExtractNamespace =... |
2,334 | bf18ac22bb9d90ff389441990d146ba1 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=179-184/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getLimiterExtractorReportKeys() | function | private List<String> getLimiterExtractorReportKeys() {
List<String> keyNames = new ArrayList<>();
keyNames.add(KafkaSource.TOPIC_NAME);
keyNames.add(KafkaSource.PARTITION_ID);
return keyNames;
} |
2,335 | afa81f20b548af28ff61d53bab2cebd6 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=421-424/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::skipWorkUnit(WorkUnit workUnit) | function | @SuppressWarnings("deprecation")
private static void skipWorkUnit(WorkUnit workUnit) {
workUnit.setProp(ConfigurationKeys.WORK_UNIT_HIGH_WATER_MARK_KEY, workUnit.getLowWaterMark());
} |
2,336 | af988f4bf02d3748b65ef0597efc17bc | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=601-605/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getPreviousStopFetchEpochTimeForPartition(KafkaPartition partition, SourceState state) | function | private long getPreviousStopFetchEpochTimeForPartition(KafkaPartition partition, SourceState state) {
getAllPreviousOffsetState(state);
return this.previousStopFetchEpochTimes.containsKey(partition) ?
this.previousStopFetchEpochTimes.get(partition) : 0;
} |
2,337 | 6566c0840d387bd4d82f796095e9ad11 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=719-733/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::shouldMoveToLatestOffset(KafkaPartition partition, SourceState state) | function | /**
* A topic can be configured to move to the latest offset in {@link #TOPICS_MOVE_TO_LATEST_OFFSET}.
*
* Need to be synchronized as access by multiple threads
*/
private synchronized boolean shouldMoveToLatestOffset(KafkaPartition partition, SourceState state) {
if (!state.contains(TOP... |
2,338 | 0b0eaf607f2a057e222b3a1e5aeec662 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=186-194/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::setLimiterReportKeyListToWorkUnits(List<WorkUnit> workUnits, List<String> keyNameList) | function | private void setLimiterReportKeyListToWorkUnits(List<WorkUnit> workUnits, List<String> keyNameList) {
if (keyNameList.isEmpty()) {
return;
}
String keyList = Joiner.on(',').join(keyNameList.iterator());
for (WorkUnit workUnit : workUnits) {
workUnit.setProp(Limite... |
2,339 | a0105dc704a10f635422337c63023f02 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=426-570/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getWorkUnitForTopicPartition(KafkaPartition partition, SourceState state,
Optional<State> topicSpecificState) | function | private WorkUnit getWorkUnitForTopicPartition(KafkaPartition partition, SourceState state,
Optional<State> topicSpecificState) {
Offsets offsets = new Offsets();
boolean failedToGetKafkaOffsets = false;
try (Timer.Context context = this.metricC... |
2,340 | 6ad020ffa16d7182a5276d09fbf30e74 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=607-619/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getPreviousOffsetFetchEpochTimeForPartition(KafkaPartition partition, SourceState state) | function | private long getPreviousOffsetFetchEpochTimeForPartition(KafkaPartition partition, SourceState state)
throws PreviousOffsetNotFoundException {
getAllPreviousOffsetState(state);
if (this.previousOffsetFetchEpochTimes.containsKey(partition)) {
return this.previousOffsetFetchEpoch... |
2,341 | 655f562bdcc1ae346e999aec7a205007 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=896-920/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::WorkUnitCreator::run() | function | @Override
public void run() {
try (Timer.Context context = metricContext.timer(WORK_UNITS_FOR_TOPIC_TIMER).time()) {
// use shared client if configure, otherwise set a thread local one from the pool
if (KafkaSource.this.sharedKafkaConsumerClient != null) {
... |
2,342 | f225803848a03bd773dcd8483c984c8e | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=411-419/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::isTopicQualified(KafkaTopic topic) | function | /**
* Whether a {@link KafkaTopic} is qualified to be pulled.
*
* This method can be overridden by subclasses for verifying topic eligibility, e.g., one may want to
* skip a topic if its schema cannot be found in the schema registry.
*/
protected boolean isTopicQualified(KafkaTopic topic) {... |
2,343 | bb3a0bad7ccb66b8a0fa9c3fb5b58aaf | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=196-313/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getWorkunits(SourceState state) | function | @Override
public List<WorkUnit> getWorkunits(SourceState state) {
this.metricContext = Instrumented.getMetricContext(state, KafkaSource.class);
this.lineageInfo = LineageInfo.getLineageInfo(state.getBroker());
Map<String, List<WorkUnit>> workUnits = Maps.newConcurrentMap();
if (stat... |
2,344 | 14b769535b967bc03f15513909502986 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=385-409/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getWorkUnitsForTopic(KafkaTopic topic, SourceState state, Optional<State> topicSpecificState) | function | /*
* This function need to be thread safe since it is called in the Runnable
*/
private List<WorkUnit> getWorkUnitsForTopic(KafkaTopic topic, SourceState state, Optional<State> topicSpecificState) {
Timer.Context context = this.metricContext.timer("isTopicQualifiedTimer").time();
boolean t... |
2,345 | dfb80bfcfde69f2c77007c76e2f01bd5 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=862-870/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::Offsets::startAt(long offset) | function | private void startAt(long offset)
throws StartOffsetOutOfRangeException {
if (offset < this.earliestOffset || offset > this.latestOffset) {
throw new StartOffsetOutOfRangeException(String
.format("start offset = %d, earliest offset = %d, latest offset ... |
2,346 | b9f0ee0a3ea1512e58e574a03be16db1 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=315-321/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::populateClientPool(int count,
GobblinKafkaConsumerClientFactory kafkaConsumerClientFactory,
Config config) | function | protected void populateClientPool(int count,
GobblinKafkaConsumerClientFactory kafkaConsumerClientFactory,
Config config) {
for (int i = 0; i < count; i++) {
kafkaConsumerClientPool.offer(kafkaConsumerClientFactory.create(co... |
2,347 | 59ddf2858684d13ec0813f278f34c383 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=872-874/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::Offsets::startAtEarliestOffset() | function | private void startAtEarliestOffset() {
this.startOffset = this.earliestOffset;
} |
2,348 | ffffebb43ad71e5f995627a117531fc5 | swh:1:cnt:fc598aa15de2eaee306427600eaed6c7d02e0fe8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=236-239/ | d9547b8e70c33a4671eae530cd41af1db8f2cacf | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/KafkaSource.java | KafkaSource::getWorkunits::apply(KafkaTopic topic) | function | @Override
public String apply(KafkaTopic topic) {
return topic.getName();
} |
2,349 | c6a9d92ce166448a8059720098c38ece | swh:1:cnt:b3060a60cec9df2c07faecad72d113c11a861263;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=36-81/ | dbdd295e1a1c93e0aaaf07ac01ba6fdeae6088f6 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/TimePartitionedDataPublisher.java | TimePartitionedDataPublisher | type | @SuppressFBWarnings(justification = "Class copied from upstream Gobblin")
public class TimePartitionedDataPublisher extends BaseDataPublisher {
public TimePartitionedDataPublisher(State state) throws IOException {
super(state);
}
/**
* This method needs to be overridden for TimePartitionedDat... |
2,350 | 6143b09e715978825555ef0a1656d32b | swh:1:cnt:b3060a60cec9df2c07faecad72d113c11a861263;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=43-58/ | dbdd295e1a1c93e0aaaf07ac01ba6fdeae6088f6 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/TimePartitionedDataPublisher.java | TimePartitionedDataPublisher::addWriterOutputToNewDir(Path writerOutput, Path publisherOutput, WorkUnitState workUnitState,
int branchId, ParallelRunner parallelRunner) | function | /**
* This method needs to be overridden for TimePartitionedDataPublisher, since the output folder structure
* contains timestamp, we need to move the files recursively.
*
* For example, move {writerOutput}/2015/04/08/15/output.avro to {publisherOutput}/2015/04/08/15/output.avro
*/
@Overrid... |
2,351 | 6102e6ecc4b8cd79d8eb01cfd8ee49d1 | swh:1:cnt:b3060a60cec9df2c07faecad72d113c11a861263;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=60-80/ | dbdd295e1a1c93e0aaaf07ac01ba6fdeae6088f6 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/copy/TimePartitionedDataPublisher.java | TimePartitionedDataPublisher::addWriterOutputToExistingDir(Path writerOutput, Path publisherOutput, WorkUnitState workUnitState,
int branchId, ParallelRunner parallelRunner) | function | /**
* This method needs to be overridden for TimePartitionedDataPublisher, since the output folder structure
* contains timestamp, we have to move the files recursively.
*
* For example, move {writerOutput}/2015/04/08/15/output.avro to {publisherOutput}/2015/04/08/15/output.avro
*/
@Overrid... |
2,352 | 22dacf30eb097e6db6acbeb54950526f | swh:1:cnt:80311b081738dd9a443e3632f9b0a9f8ba0af62e;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=39-143/ | 23b49efd88836d007ff29c1a61796c977bbe5d96 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/Kafka1TimestampedRecordExtractor.java | Kafka1TimestampedRecordExtractor | type | /**
* Extracts {@link TimestampedRecord} records from Kafka using Kafka1 client.
* The extracted record timestamp is set to the kafka record timestamp if the kafka
* record timestamp-type is in the list of extracted-timestamp-types defined using
* the property source.kafka.extract.timestampTypes (accepted values ar... |
2,353 | 2480595fbbba889a84ba2ca9d65658b4 | swh:1:cnt:80311b081738dd9a443e3632f9b0a9f8ba0af62e;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=91-100/ | 23b49efd88836d007ff29c1a61796c977bbe5d96 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/Kafka1TimestampedRecordExtractor.java | Kafka1TimestampedRecordExtractor::getUseCurrentTimestampAsDefault(WorkUnitState state) | function | /**
* Uses state CURRENT_TIMESTAMP_AS_DEFAULT_KEY property to define if record timestamp
* should be set to current-time if kafka timestamp can't be used (by opposition to be absent).
*
* @return The {@link TimestampType} list, empty if the property is not present.
*/
private boolean getUse... |
2,354 | 06e43febda2fb2bc04adce2d6ceb4018 | swh:1:cnt:80311b081738dd9a443e3632f9b0a9f8ba0af62e;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=129-135/ | 23b49efd88836d007ff29c1a61796c977bbe5d96 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/Kafka1TimestampedRecordExtractor.java | Kafka1TimestampedRecordExtractor::decodeRecord(ByteArrayBasedKafkaRecord kafkaConsumerRecord) | function | /**
* Unreachable, as {@link KafkaExtractor#decodeKafkaMessage(KafkaConsumerRecord)} is override not to use this method.
*/
@Override
protected Object decodeRecord(ByteArrayBasedKafkaRecord kafkaConsumerRecord) throws IOException {
throw new IllegalArgumentException("Could not decode Kafka rec... |
2,355 | 92b3b05c97a5fb1c25abe3e7cfd20f08 | swh:1:cnt:80311b081738dd9a443e3632f9b0a9f8ba0af62e;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=64-89/ | 23b49efd88836d007ff29c1a61796c977bbe5d96 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/Kafka1TimestampedRecordExtractor.java | Kafka1TimestampedRecordExtractor::getExtractedTimestampTypes(WorkUnitState state) | function | /**
* Uses state EXTRACTED_TIMESTAMP_TYPES_KEY property to construct a list
* of {@link TimestampType} defining the types of kafka-timestamps that
* will lead to extracted records having kafka timestamp set.
* Accepted values are CreateTime and LogAppendTime, or unset-property (leading
* to all... |
2,356 | ebb43b07920f379c65af9454394b1e49 | swh:1:cnt:80311b081738dd9a443e3632f9b0a9f8ba0af62e;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=102-127/ | 23b49efd88836d007ff29c1a61796c977bbe5d96 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/Kafka1TimestampedRecordExtractor.java | Kafka1TimestampedRecordExtractor::decodeKafkaMessage(KafkaConsumerRecord message) | function | /**
* We need to override this protected method as the kafka timestamp information is not
* available in the {@link KafkaExtractor#decodeRecord(ByteArrayBasedKafkaRecord)} abstract method.
*/
@Override
protected TimestampedRecord<P> decodeKafkaMessage(KafkaConsumerRecord message) throws DataRecor... |
2,357 | a81d7bf02031cba0fe3a8e3209a5131d | swh:1:cnt:80311b081738dd9a443e3632f9b0a9f8ba0af62e;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=137-141/ | 23b49efd88836d007ff29c1a61796c977bbe5d96 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/Kafka1TimestampedRecordExtractor.java | Kafka1TimestampedRecordExtractor::getSchema() | function | // TODO: Implement schema getter option (for events!)
@Override
public Object getSchema() {
return null;
} |
2,358 | 7d29094d29f8dcfa520939a18dfca551 | swh:1:cnt:43b29e7f440f8f8ef7e48b2f0ea6cf05b9bc6920;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=24-29/ | 6cf707ddab2a6b103fdab773f632d9f15cad42ab | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/Kafka1TimestampedRecordSource.java | Kafka1TimestampedRecordSource | type | public class Kafka1TimestampedRecordSource extends WikimediaKafkaSource<Object, Object> {
@Override
public Extractor<Object, Object> getExtractor(WorkUnitState state) {
return new Kafka1TimestampedRecordExtractor(state);
}
} |
2,359 | 5894ba1980cd1a71e41a65c6a6a52e70 | swh:1:cnt:43b29e7f440f8f8ef7e48b2f0ea6cf05b9bc6920;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=25-28/ | 6cf707ddab2a6b103fdab773f632d9f15cad42ab | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/Kafka1TimestampedRecordSource.java | Kafka1TimestampedRecordSource::getExtractor(WorkUnitState state) | function | @Override
public Extractor<Object, Object> getExtractor(WorkUnitState state) {
return new Kafka1TimestampedRecordExtractor(state);
} |
2,360 | fe3f366eba2b64229051299d2ba85014 | swh:1:cnt:bca42ce63a28a128756929b2c9d1819be4fedee8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=39-135/ | 6b4b6e5741dec36ac59c1c7c4904db6d2726025a | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/WikimediaKafkaSource.java | WikimediaKafkaSource | type | @Slf4j
public abstract class WikimediaKafkaSource<S, D> extends KafkaSource<S, D> {
private static final String TOPIC_INCLUDE_LIST = "topic.include";
private static final String TOPIC_EXCLUDE_LIST = "topic.exclude";
private static final String EVENT_STREAM_CONFIG_URI = "event_stream_config.uri";
privat... |
2,361 | 4e31a45c7650ba2b0f737d67345f5833 | swh:1:cnt:bca42ce63a28a128756929b2c9d1819be4fedee8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=49-128/ | 6b4b6e5741dec36ac59c1c7c4904db6d2726025a | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/WikimediaKafkaSource.java | WikimediaKafkaSource::getFilteredTopics(SourceState state) | function | /**
* Finds Kafka topics to ingest. Defaults to a literal include list. In absence of that,
* uses Wikimedia's EventStreamConfig service to get a list of topics based on:
* - a configured service URI
* - a list of stream names to get topics from
* - a list of settings filters in the form k... |
2,362 | bf9c84c78372619955f5c51d074a6ea8 | swh:1:cnt:bca42ce63a28a128756929b2c9d1819be4fedee8;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=130-134/ | 6b4b6e5741dec36ac59c1c7c4904db6d2726025a | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/kafka/WikimediaKafkaSource.java | WikimediaKafkaSource::settingsListToMap(Collection<String> settingsFilters) | function | protected Map<String, String> settingsListToMap(Collection<String> settingsFilters) {
return settingsFilters.stream()
.map(s -> s.split(":"))
.collect(toMap(kv -> kv[0], kv -> kv[1]));
} |
2,363 | 7b8cadfaa049359238070cdbbfd6ae83 | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=37-326/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter | type | /**
* Class converting and sending Gobblin reporting events to Prometheus PushGateway.
* This class is specific to WMF as the event conversion between Gobblin reporting
* system and Prometheus is very much ad-hoc.
*
* This class contains quite some boilerplate to follow its parent-class Factory pattern.
*
* This... |
2,364 | 402824a54108a9b8bbc3074b0420ce1f | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=132-156/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter::Builder | type | /**
* A builder for {@link PrometheusEventReporter} instances.
*/
public abstract static class Builder<T extends EventReporter.Builder<T>> extends EventReporter.Builder<T> {
protected String prometheusJobName;
protected String pushGatewayUrl;
protected Builder(MetricContext conte... |
2,365 | 549d6ac23c9f9f587348f0065776932f | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=121-130/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter::BuilderImpl | type | public static final class BuilderImpl extends Builder<BuilderImpl> {
private BuilderImpl(MetricContext context) {
super(context);
}
@Override
protected PrometheusEventReporter.BuilderImpl self() {
return this;
}
} |
2,366 | a0b6e7812b60a2b9d765ebdb465557a8 | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=115-119/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter::BuilderFactory | type | public static class BuilderFactory {
public static PrometheusEventReporter.BuilderImpl forContext(MetricContext context) {
return new PrometheusEventReporter.BuilderImpl(context);
}
} |
2,367 | 4b9177e16421e20bcf602d58b5e5ed62 | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=187-325/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter::reportEventQueue(Queue<GobblinTrackingEvent> queue) | function | /**
* Loop through each event in the queue. If it is
* an event we are interested in, convert it to a Prometheus Gauge
* and save it in our PrometheusPusher.
* This assumes that each event we are interested in is only fired once per launcher or worker.
*/
@Override
@SuppressWarnings({"c... |
2,368 | e25510863005d01986398538c6c6e710 | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=126-129/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter::BuilderImpl::self() | function | @Override
protected PrometheusEventReporter.BuilderImpl self() {
return this;
} |
2,369 | b6d8ad4996f44b77abdcac72c44ed419 | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=172-185/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter::close() | function | @Override
public void close() {
// We defer actually submitting any metrics to Prometheus PushGateway until the task is closed.
// Up to this point, we have only been collecting metrics in the various CollectorRegistry instances
// in our PrometheusPusher.
// Now, we push all metrics... |
2,370 | 47ae0304fe6e3c68185ed4a7f8cd50e9 | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=145-155/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter::Builder::build(String pushGatewayUrl, String prometheusJobName) | function | /**
* Builds a {@link PrometheusEventReporter} pushing metrics with
* job=prometheusJobName to a Prometheus PushGateway server at pushGatewayUrl.
*
* @return a {@link PrometheusEventReporter}
*/
public PrometheusEventReporter build(String pushGatewayUrl, String prome... |
2,371 | a09bdbc82fd4c16f612d1a76c0505f62 | swh:1:cnt:93ca7d51f98735876a0ce160934e365279b49da5;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=116-118/ | 926335bc1491f3207dec7ba31730e0ce3b1023d4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporter.java | PrometheusEventReporter::BuilderFactory::forContext(MetricContext context) | function | public static PrometheusEventReporter.BuilderImpl forContext(MetricContext context) {
return new PrometheusEventReporter.BuilderImpl(context);
} |
2,372 | f816f779f0b212f7d4224161df111ccd | swh:1:cnt:330ae8551b47d97312165c871514bf10e2d2ad74;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=35-76/ | bc985eb7ba5adda7b167b0e66ea42ac9ab298950 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporterFactory.java | PrometheusEventReporterFactory | type | // NOTE: EventReporter factories are expected to implement CustomCodahaleReporterFactory,
// whereas MetricsReporter factories are expected to implement
// org.apache.gobblin.metrics.CustomReporterFactory. ¯\_(ツ)_/¯
/**
* Factory class for {@link PrometheusEventReporter} to be used in job configuration.
*/
@Slf4j
pu... |
2,373 | 30fe08a4c1c63314140b0eadb7762c87 | swh:1:cnt:330ae8551b47d97312165c871514bf10e2d2ad74;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=46-74/ | bc985eb7ba5adda7b167b0e66ea42ac9ab298950 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusEventReporterFactory.java | PrometheusEventReporterFactory::newScheduledReporter(MetricRegistry registry, Properties properties) | function | @Override
public ScheduledReporter newScheduledReporter(MetricRegistry registry, Properties properties) throws IOException {
try {
Preconditions.checkArgument(
properties.containsKey(METRICS_REPORTING_PROMETHEUS_PUSHGATEWAY_URL),
"Prometheus PushGateway URL is no... |
2,374 | d980b94535a02ddc15907f25fd8905f6 | swh:1:cnt:fb4d7d113a2b7c1fdeaf1281abf0346597d9360c;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=14-125/ | 1d6501be70171e94e73c77b8523937110afc777b | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusPusher.java | PrometheusPusher | type | /**
* Wrapper class to aid in pushing metrics to Prometheus PushGateway,
* making sure that CollectorRegistry instances are associated with
* groupingKeys, so that we can call push with the desired groupingKeys
* for each group of metrics.
*
* This assumes that each metric will only be set ONCE.
* This is useful... |
2,375 | ea3e68e5758239191279dd870844f87f | swh:1:cnt:fb4d7d113a2b7c1fdeaf1281abf0346597d9360c;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=30-61/ | 1d6501be70171e94e73c77b8523937110afc777b | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusPusher.java | PrometheusPusher::Builder | type | public static class Builder {
private String pushGatetwayUrl;
private String jobName;
public Builder() { }
public Builder url(String url) {
this.pushGatetwayUrl = url;
return this;
}
public Builder job(String jobName) {
this.jobName ... |
2,376 | 6949a98bd5dfec022ccfa39b5d2add45 | swh:1:cnt:fb4d7d113a2b7c1fdeaf1281abf0346597d9360c;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=36-39/ | 1d6501be70171e94e73c77b8523937110afc777b | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusPusher.java | PrometheusPusher::Builder::url(String url) | function | public Builder url(String url) {
this.pushGatetwayUrl = url;
return this;
} |
2,377 | be69d873929d7e517958cc3a37a5e5b3 | swh:1:cnt:fb4d7d113a2b7c1fdeaf1281abf0346597d9360c;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=112-123/ | 1d6501be70171e94e73c77b8523937110afc777b | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusPusher.java | PrometheusPusher::push() | function | /**
* Push all metrics to PushGateway by groupingKeys, then clear each registry.
* @throws IOException if push fails.
*/
public void push() throws IOException {
for (Map.Entry<Map<String, String>, CollectorRegistry> entry : groupingKeyToRegistry.entrySet()) {
Map<String, String> g... |
2,378 | 8aabb47926c105ac7196e689a3e0efbf | swh:1:cnt:fb4d7d113a2b7c1fdeaf1281abf0346597d9360c;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=46-60/ | 1d6501be70171e94e73c77b8523937110afc777b | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusPusher.java | PrometheusPusher::Builder::build() | function | public PrometheusPusher build() {
Preconditions.checkArgument(
this.pushGatetwayUrl != null,
"Must set Prometheus PushGateway url"
);
Preconditions.checkArgument(
this.jobName != null,
"Must set Prometheus job name"
... |
2,379 | 0d6941c2f7d1457e3049b743b61a0458 | swh:1:cnt:fb4d7d113a2b7c1fdeaf1281abf0346597d9360c;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=41-44/ | 1d6501be70171e94e73c77b8523937110afc777b | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusPusher.java | PrometheusPusher::Builder::job(String jobName) | function | public Builder job(String jobName) {
this.jobName = jobName;
return this;
} |
2,380 | 2ff9a5150d64d4a935de3b09a034e3c1 | swh:1:cnt:fb4d7d113a2b7c1fdeaf1281abf0346597d9360c;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=74-110/ | 1d6501be70171e94e73c77b8523937110afc777b | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/metrics/prometheus/PrometheusPusher.java | PrometheusPusher::gauge(String name, String help, Map<String, String> labels, Map<String, String> groupingKey, double value) | function | /**
* Adds a new Gauge metric to be pushed.
* Do not call this metric more than once for the same metric name in the samem process.
*
* @param name Prometheus metric name
* @param help Prometheus metric help
* @param labels Prometheus metric label keys to values
* @param groupingKey P... |
2,381 | 2405a70494f22b911f0901828448441d | swh:1:cnt:e1d5947d26797c01e1cf5b9658074394e7c6a4d1;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=15-45/ | f68357e641417e2af41c09209cdef7131cc68e11 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/ParallelRunnerWithTouch.java | ParallelRunnerWithTouch | type | public class ParallelRunnerWithTouch extends ParallelRunner {
private static final Logger LOGGER = LoggerFactory.getLogger(ParallelRunnerWithTouch.class);
private final Striped<Lock> locks = Striped.lazyWeakLock(2147483647);
public ParallelRunnerWithTouch(int threads, FileSystem fs) {
super(threa... |
2,382 | 73307f53f6000f82a36edc1c1cd6e907 | swh:1:cnt:e1d5947d26797c01e1cf5b9658074394e7c6a4d1;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=25-44/ | f68357e641417e2af41c09209cdef7131cc68e11 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/ParallelRunnerWithTouch.java | ParallelRunnerWithTouch::touchPath(final Path path) | function | public void touchPath(final Path path) {
this.submitCallable(() -> {
Lock lock = locks.get(path.toString());
lock.lock();
try {
if (getFs().isDirectory(path.getParent())) {
if (!getFs().exists(path)) {
getFs().create... |
2,383 | 9e3c7f6d7eb4df88b3d7455c3f06e497 | swh:1:cnt:afc2891f96adf5aebc3d087e44ec9e1b92b19f34;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=32-56/ | c9afeeee36cff4c3b4b0310d1fbd3b0ce043aed4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedDataPublisherWithFlag.java | TimePartitionedDataPublisherWithFlag | type | @Slf4j
public class TimePartitionedDataPublisherWithFlag extends TimePartitionedDataPublisher {
protected final TimePartitionedFlagDataPublisher flagPublisher;
public TimePartitionedDataPublisherWithFlag(State state) throws IOException {
super(state);
this.flagPublisher = this.closer.register(... |
2,384 | 9a215b80c09fe582cf4e0d0a8e71d897 | swh:1:cnt:afc2891f96adf5aebc3d087e44ec9e1b92b19f34;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=42-54/ | c9afeeee36cff4c3b4b0310d1fbd3b0ce043aed4 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedDataPublisherWithFlag.java | TimePartitionedDataPublisherWithFlag::publish(Collection<? extends WorkUnitState> states) | function | @Override
public void publish(Collection<? extends WorkUnitState> states) throws IOException {
super.publish(states);
// Update PUBLISHER_DIRS from parent-task
log.debug("Adding published dirs to global state before applying flag-publishing");
for (Path path : this.publisherOutputDi... |
2,385 | b323485a9ad3327c22cf1072b44b4f74 | swh:1:cnt:f2fcb0d320229f7086f1234831c0464cec28fe3d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=50-235/ | db9bfb9bd9c2033680f4dcf5ffb2eaf3c6abe58d | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedFlagDataPublisher.java | TimePartitionedFlagDataPublisher | type | /**
* IMPORTANT NOTES:
* - Gobblin published folders are expected to be in the form {PUBLISHERDIR}/{TABLE_NAME}/{PARTITION}
* This means that the "writer.file.path.type" property is expected to be "tablename"
* - Gobblin writter partition-scheme is expected to follow time-order when sorted alphabetically
*
*... |
2,386 | 526c3d9041f483f3a79ee4087ea633e9 | swh:1:cnt:f2fcb0d320229f7086f1234831c0464cec28fe3d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=95-105/ | db9bfb9bd9c2033680f4dcf5ffb2eaf3c6abe58d | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedFlagDataPublisher.java | TimePartitionedFlagDataPublisher::getPublisherFileSystem(State state) | function | public static FileSystem getPublisherFileSystem(State state) throws IOException {
Configuration conf = new Configuration();
// Add all job configuration properties so they are picked up by Hadoop
for (String key : state.getPropertyNames()) {
conf.set(key, state.getProp(key));
... |
2,387 | 8ea3b7d7ce49697a35aff43167f17202 | swh:1:cnt:f2fcb0d320229f7086f1234831c0464cec28fe3d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=192-215/ | db9bfb9bd9c2033680f4dcf5ffb2eaf3c6abe58d | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedFlagDataPublisher.java | TimePartitionedFlagDataPublisher::writeFlags(Map<String, Set<String>> tablesPartitions) | function | /**
* This function creates tasks to asynchronously write flags as defined in the tablesPartitions
* parameter.
* @param tablesPartitions A map of tables and their partitions to be flagged
*/
private void writeFlags(Map<String, Set<String>> tablesPartitions) {
String publisherFinalBaseDi... |
2,388 | f8444f4a1bbc5d5aff5c2b56c789dec6 | swh:1:cnt:f2fcb0d320229f7086f1234831c0464cec28fe3d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=124-190/ | db9bfb9bd9c2033680f4dcf5ffb2eaf3c6abe58d | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedFlagDataPublisher.java | TimePartitionedFlagDataPublisher::getPartitionsToFlagByTable(Collection<? extends WorkUnitState> states) | function | /**
* This function loops over workUnitStates and extracts for each processed table the time-partitions to flag as:
* - Any time-partition being less than the minimum across the maximum-time-partitions per table-partition.
*/
@SuppressWarnings("checkstyle:CyclomaticComplexity") // FIXME: this method... |
2,389 | 65b47146e445ec05511c0acb65dec191 | swh:1:cnt:f2fcb0d320229f7086f1234831c0464cec28fe3d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=107-111/ | db9bfb9bd9c2033680f4dcf5ffb2eaf3c6abe58d | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedFlagDataPublisher.java | TimePartitionedFlagDataPublisher::initialize() | function | @Deprecated
@Override
public void initialize() {
// no initialization required
} |
2,390 | 917841579f03cbf71d746f100bc0e40d | swh:1:cnt:f2fcb0d320229f7086f1234831c0464cec28fe3d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=217-228/ | db9bfb9bd9c2033680f4dcf5ffb2eaf3c6abe58d | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedFlagDataPublisher.java | TimePartitionedFlagDataPublisher::publishData(Collection<? extends WorkUnitState> states) | function | @Override
public void publishData(Collection<? extends WorkUnitState> states) throws IOException {
log.debug("Compute time-partitions to flag");
Map<String, Set<String>> tablesPartitions = getPartitionsToFlagByTable(states);
log.debug("Write flags in time-partition folders");
write... |
2,391 | d48f7dc526004d9b56bb300331947cab | swh:1:cnt:f2fcb0d320229f7086f1234831c0464cec28fe3d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=230-233/ | db9bfb9bd9c2033680f4dcf5ffb2eaf3c6abe58d | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedFlagDataPublisher.java | TimePartitionedFlagDataPublisher::publishMetadata(Collection<? extends WorkUnitState> states) | function | @Override
public void publishMetadata(Collection<? extends WorkUnitState> states) throws IOException {
// Nothing to do
} |
2,392 | b8795acea9c8719ad6ee9848b1c76c83 | swh:1:cnt:f2fcb0d320229f7086f1234831c0464cec28fe3d;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=113-122/ | db9bfb9bd9c2033680f4dcf5ffb2eaf3c6abe58d | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/publisher/TimePartitionedFlagDataPublisher.java | TimePartitionedFlagDataPublisher::close() | function | @Override
public void close() throws IOException {
try {
for (Path path : this.publishedFlags) {
this.state.appendToSetProp(PUBLISHER_PUBLISHED_FLAGS_KEY, path.toString());
}
} finally {
this.closer.close();
}
} |
2,393 | c26c15c69a641ba421e32b9589b94b78 | swh:1:cnt:f3198d9e14d6358cb703cea2ae6ca510b1c54730;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=37-133/ | c0cfcb9bb5e981afc32f31e395c75e10204c72f6 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/utils/JsonStringTimestampExtractor.java | JsonStringTimestampExtractor | type | /**
* A utility class parsing JSON from byte[] ans extracting a timestamp from the data.
*
* The class provides static functions to initialize both the timestamp and the
* timestamp-format fields from a WriterPartitioner.
*
* If a record doesn't contain the specified field, or if no field is specified, the curren... |
2,394 | 79571468405cdb8867b1536a23c66d90 | swh:1:cnt:f3198d9e14d6358cb703cea2ae6ca510b1c54730;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=125-131/ | c0cfcb9bb5e981afc32f31e395c75e10204c72f6 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/utils/JsonStringTimestampExtractor.java | JsonStringTimestampExtractor::TimestampFormat | type | public enum TimestampFormat {
unix,
unix_seconds,
unix_milliseconds,
ISO_8601,
CUSTOM
} |
2,395 | 37e3805c84452cd3385c2fd4a7423b2a | swh:1:cnt:f3198d9e14d6358cb703cea2ae6ca510b1c54730;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=81-123/ | c0cfcb9bb5e981afc32f31e395c75e10204c72f6 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/utils/JsonStringTimestampExtractor.java | JsonStringTimestampExtractor::getRecordTimestamp(String payload) | function | @SuppressWarnings({"checkstyle:CyclomaticComplexity", "checkstyle:IllegalCatch"}) // FIXME: this method needs to be refactored
public long getRecordTimestamp(String payload) {
JsonNode root;
long ifNotFound = System.currentTimeMillis();
try {
root = cachingMapper.readTree(payload... |
2,396 | 98b5a7b834bccc4c58653d62099ee3b7 | swh:1:cnt:48a2e25be1ce1e50e083e12cedf1219dbe7b58e9;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=30-110/ | 4c4c61812f396c53f9db8501e35270ce8bd47102 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriter.java | SimpleStringWriter | type | /**
* Copied and updated from SimpleDataWriter.
*/
public class SimpleStringWriter extends FsDataWriter<String> {
private final Byte recordDelimiter; // optional byte to place between each record write
private int recordsWritten;
private int bytesWritten;
private final OutputStream stagingFileOutpu... |
2,397 | 097b17a3c6d7057c21dab0f292efa8a1 | swh:1:cnt:48a2e25be1ce1e50e083e12cedf1219dbe7b58e9;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=88-96/ | 4c4c61812f396c53f9db8501e35270ce8bd47102 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriter.java | SimpleStringWriter::bytesWritten() | function | /**
* Get the number of bytes written.
*
* @return number of bytes written
*/
@Override
public long bytesWritten() throws IOException {
return this.bytesWritten;
} |
2,398 | 0b74f78aaea847d80bbaf3e42d323982 | swh:1:cnt:48a2e25be1ce1e50e083e12cedf1219dbe7b58e9;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=78-86/ | 4c4c61812f396c53f9db8501e35270ce8bd47102 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriter.java | SimpleStringWriter::recordsWritten() | function | /**
* Get the number of records written.
*
* @return number of records written
*/
@Override
public long recordsWritten() {
return this.recordsWritten;
} |
2,399 | 17f87863d19b3dfcba8c03682890af75 | swh:1:cnt:48a2e25be1ce1e50e083e12cedf1219dbe7b58e9;origin=https://gitlab.wikimedia.org/repos/data-engineering/gobblin-wmf-deprecated.git;lines=98-101/ | 4c4c61812f396c53f9db8501e35270ce8bd47102 | gobblin-wmf-deprecated | analytics | gobblin-wmf-core/src/main/java/org/wikimedia/gobblin/writer/SimpleStringWriter.java | SimpleStringWriter::isSpeculativeAttemptSafe() | function | @Override
public boolean isSpeculativeAttemptSafe() {
return this.writerAttemptIdOptional.isPresent() && this.getClass() == SimpleStringWriter.class;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.