id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
25,800
apache/incubator-gobblin
gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/extractor/InstrumentedExtractorBase.java
InstrumentedExtractorBase.afterRead
public void afterRead(D record, long startTime) { Instrumented.updateTimer(this.extractorTimer, System.nanoTime() - startTime, TimeUnit.NANOSECONDS); if (record != null) { Instrumented.markMeter(this.readRecordsMeter); } }
java
public void afterRead(D record, long startTime) { Instrumented.updateTimer(this.extractorTimer, System.nanoTime() - startTime, TimeUnit.NANOSECONDS); if (record != null) { Instrumented.markMeter(this.readRecordsMeter); } }
[ "public", "void", "afterRead", "(", "D", "record", ",", "long", "startTime", ")", "{", "Instrumented", ".", "updateTimer", "(", "this", ".", "extractorTimer", ",", "System", ".", "nanoTime", "(", ")", "-", "startTime", ",", "TimeUnit", ".", "NANOSECONDS", ...
Called after each record is read. @param record record read. @param startTime reading start time.
[ "Called", "after", "each", "record", "is", "read", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/instrumented/extractor/InstrumentedExtractorBase.java#L208-L213
25,801
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/MultiTimingEvent.java
MultiTimingEvent.nextStage
public void nextStage(String name) throws IOException { endStage(); this.currentStage = name; this.currentStageStart = System.currentTimeMillis(); }
java
public void nextStage(String name) throws IOException { endStage(); this.currentStage = name; this.currentStageStart = System.currentTimeMillis(); }
[ "public", "void", "nextStage", "(", "String", "name", ")", "throws", "IOException", "{", "endStage", "(", ")", ";", "this", ".", "currentStage", "=", "name", ";", "this", ".", "currentStageStart", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "}"...
End the previous stage, record the time spent in that stage, and start the timer for a new stage. @param name name of the new stage. @throws IOException
[ "End", "the", "previous", "stage", "record", "the", "time", "spent", "in", "that", "stage", "and", "start", "the", "timer", "for", "a", "new", "stage", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/MultiTimingEvent.java#L88-L92
25,802
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/MultiTimingEvent.java
MultiTimingEvent.endStage
public void endStage() { if (this.currentStage != null) { long time = System.currentTimeMillis() - this.currentStageStart; this.timings.add(new Stage(this.currentStage, time)); if (reportAsMetrics && submitter.getMetricContext().isPresent()) { String timerName = submitter.getNamespace() + ...
java
public void endStage() { if (this.currentStage != null) { long time = System.currentTimeMillis() - this.currentStageStart; this.timings.add(new Stage(this.currentStage, time)); if (reportAsMetrics && submitter.getMetricContext().isPresent()) { String timerName = submitter.getNamespace() + ...
[ "public", "void", "endStage", "(", ")", "{", "if", "(", "this", ".", "currentStage", "!=", "null", ")", "{", "long", "time", "=", "System", ".", "currentTimeMillis", "(", ")", "-", "this", ".", "currentStageStart", ";", "this", ".", "timings", ".", "ad...
End the previous stage and record the time spent in that stage.
[ "End", "the", "previous", "stage", "and", "record", "the", "time", "spent", "in", "that", "stage", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/MultiTimingEvent.java#L97-L107
25,803
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/MultiTimingEvent.java
MultiTimingEvent.submit
public void submit(Map<String, String> additionalMetadata) throws IOException { if (this.submitted) { throw new IOException("MultiTimingEvent has already been submitted."); } this.submitted = true; endStage(); Map<String, String> finalMetadata = Maps.newHashMap(); finalMetadata.putAll(a...
java
public void submit(Map<String, String> additionalMetadata) throws IOException { if (this.submitted) { throw new IOException("MultiTimingEvent has already been submitted."); } this.submitted = true; endStage(); Map<String, String> finalMetadata = Maps.newHashMap(); finalMetadata.putAll(a...
[ "public", "void", "submit", "(", "Map", "<", "String", ",", "String", ">", "additionalMetadata", ")", "throws", "IOException", "{", "if", "(", "this", ".", "submitted", ")", "{", "throw", "new", "IOException", "(", "\"MultiTimingEvent has already been submitted.\"...
Ends the current stage and submits the event containing the timings of each event. @param additionalMetadata additional metadata to include in the event. @throws IOException
[ "Ends", "the", "current", "stage", "and", "submits", "the", "event", "containing", "the", "timings", "of", "each", "event", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/event/MultiTimingEvent.java#L122-L139
25,804
apache/incubator-gobblin
gobblin-admin/src/main/java/org/apache/gobblin/cli/AdminClient.java
AdminClient.queryByJobId
public Optional<JobExecutionInfo> queryByJobId(String id) throws RemoteInvocationException { JobExecutionQuery query = new JobExecutionQuery(); query.setIdType(QueryIdTypeEnum.JOB_ID); query.setId(JobExecutionQuery.Id.create(id)); query.setLimit(1); List<JobExecutionInfo> results = executeQuery(que...
java
public Optional<JobExecutionInfo> queryByJobId(String id) throws RemoteInvocationException { JobExecutionQuery query = new JobExecutionQuery(); query.setIdType(QueryIdTypeEnum.JOB_ID); query.setId(JobExecutionQuery.Id.create(id)); query.setLimit(1); List<JobExecutionInfo> results = executeQuery(que...
[ "public", "Optional", "<", "JobExecutionInfo", ">", "queryByJobId", "(", "String", "id", ")", "throws", "RemoteInvocationException", "{", "JobExecutionQuery", "query", "=", "new", "JobExecutionQuery", "(", ")", ";", "query", ".", "setIdType", "(", "QueryIdTypeEnum",...
Retrieve a Gobblin job by its id. @param id Id of the job to retrieve @return JobExecutionInfo representing the job
[ "Retrieve", "a", "Gobblin", "job", "by", "its", "id", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-admin/src/main/java/org/apache/gobblin/cli/AdminClient.java#L66-L74
25,805
apache/incubator-gobblin
gobblin-admin/src/main/java/org/apache/gobblin/cli/AdminClient.java
AdminClient.queryAllJobs
public List<JobExecutionInfo> queryAllJobs(QueryListType lookupType, int resultsLimit) throws RemoteInvocationException { JobExecutionQuery query = new JobExecutionQuery(); query.setIdType(QueryIdTypeEnum.LIST_TYPE); query.setId(JobExecutionQuery.Id.create(lookupType)); // Disable properties and ...
java
public List<JobExecutionInfo> queryAllJobs(QueryListType lookupType, int resultsLimit) throws RemoteInvocationException { JobExecutionQuery query = new JobExecutionQuery(); query.setIdType(QueryIdTypeEnum.LIST_TYPE); query.setId(JobExecutionQuery.Id.create(lookupType)); // Disable properties and ...
[ "public", "List", "<", "JobExecutionInfo", ">", "queryAllJobs", "(", "QueryListType", "lookupType", ",", "int", "resultsLimit", ")", "throws", "RemoteInvocationException", "{", "JobExecutionQuery", "query", "=", "new", "JobExecutionQuery", "(", ")", ";", "query", "....
Retrieve all jobs @param lookupType Query type @return List of all jobs (limited by results limit)
[ "Retrieve", "all", "jobs" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-admin/src/main/java/org/apache/gobblin/cli/AdminClient.java#L82-L95
25,806
apache/incubator-gobblin
gobblin-admin/src/main/java/org/apache/gobblin/cli/AdminClient.java
AdminClient.queryByJobName
public List<JobExecutionInfo> queryByJobName(String name, int resultsLimit) throws RemoteInvocationException { JobExecutionQuery query = new JobExecutionQuery(); query.setIdType(QueryIdTypeEnum.JOB_NAME); query.setId(JobExecutionQuery.Id.create(name)); query.setIncludeTaskExecutions(false); query.se...
java
public List<JobExecutionInfo> queryByJobName(String name, int resultsLimit) throws RemoteInvocationException { JobExecutionQuery query = new JobExecutionQuery(); query.setIdType(QueryIdTypeEnum.JOB_NAME); query.setId(JobExecutionQuery.Id.create(name)); query.setIncludeTaskExecutions(false); query.se...
[ "public", "List", "<", "JobExecutionInfo", ">", "queryByJobName", "(", "String", "name", ",", "int", "resultsLimit", ")", "throws", "RemoteInvocationException", "{", "JobExecutionQuery", "query", "=", "new", "JobExecutionQuery", "(", ")", ";", "query", ".", "setId...
Query jobs by name @param name Name of the job to query for @param resultsLimit Max # of results to return @return List of jobs with the name (empty list if none can be found)
[ "Query", "jobs", "by", "name" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-admin/src/main/java/org/apache/gobblin/cli/AdminClient.java#L104-L112
25,807
apache/incubator-gobblin
gobblin-admin/src/main/java/org/apache/gobblin/cli/AdminClient.java
AdminClient.executeQuery
private List<JobExecutionInfo> executeQuery(JobExecutionQuery query) throws RemoteInvocationException { JobExecutionQueryResult result = this.client.get(query); if (result != null && result.hasJobExecutions()) { return result.getJobExecutions(); } return Collections.emptyList(); }
java
private List<JobExecutionInfo> executeQuery(JobExecutionQuery query) throws RemoteInvocationException { JobExecutionQueryResult result = this.client.get(query); if (result != null && result.hasJobExecutions()) { return result.getJobExecutions(); } return Collections.emptyList(); }
[ "private", "List", "<", "JobExecutionInfo", ">", "executeQuery", "(", "JobExecutionQuery", "query", ")", "throws", "RemoteInvocationException", "{", "JobExecutionQueryResult", "result", "=", "this", ".", "client", ".", "get", "(", "query", ")", ";", "if", "(", "...
Execute a query and coerce the result into a java List @param query Query to execute @return List of jobs that matched the query. (Empty list if none did). @throws RemoteInvocationException If the server throws an error
[ "Execute", "a", "query", "and", "coerce", "the", "result", "into", "a", "java", "List" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-admin/src/main/java/org/apache/gobblin/cli/AdminClient.java#L120-L127
25,808
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/Task.java
Task.shouldPublishDataInTask
private boolean shouldPublishDataInTask() { boolean publishDataAtJobLevel = this.taskState.getPropAsBoolean(ConfigurationKeys.PUBLISH_DATA_AT_JOB_LEVEL, ConfigurationKeys.DEFAULT_PUBLISH_DATA_AT_JOB_LEVEL); if (publishDataAtJobLevel) { LOG.info(String .format("%s is true. Will publish da...
java
private boolean shouldPublishDataInTask() { boolean publishDataAtJobLevel = this.taskState.getPropAsBoolean(ConfigurationKeys.PUBLISH_DATA_AT_JOB_LEVEL, ConfigurationKeys.DEFAULT_PUBLISH_DATA_AT_JOB_LEVEL); if (publishDataAtJobLevel) { LOG.info(String .format("%s is true. Will publish da...
[ "private", "boolean", "shouldPublishDataInTask", "(", ")", "{", "boolean", "publishDataAtJobLevel", "=", "this", ".", "taskState", ".", "getPropAsBoolean", "(", "ConfigurationKeys", ".", "PUBLISH_DATA_AT_JOB_LEVEL", ",", "ConfigurationKeys", ".", "DEFAULT_PUBLISH_DATA_AT_JO...
Whether the task should directly publish its output data to the final publisher output directory. <p> The task should publish its output data directly if {@link ConfigurationKeys#PUBLISH_DATA_AT_JOB_LEVEL} is set to false AND any of the following conditions is satisfied: <ul> <li>The {@link JobCommitPolicy#COMMIT_ON_...
[ "Whether", "the", "task", "should", "directly", "publish", "its", "output", "data", "to", "the", "final", "publisher", "output", "directory", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/Task.java#L570-L591
25,809
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/Task.java
Task.inMultipleBranches
private static boolean inMultipleBranches(List<Boolean> branches) { int inBranches = 0; for (Boolean bool : branches) { if (bool && ++inBranches > 1) { break; } } return inBranches > 1; }
java
private static boolean inMultipleBranches(List<Boolean> branches) { int inBranches = 0; for (Boolean bool : branches) { if (bool && ++inBranches > 1) { break; } } return inBranches > 1; }
[ "private", "static", "boolean", "inMultipleBranches", "(", "List", "<", "Boolean", ">", "branches", ")", "{", "int", "inBranches", "=", "0", ";", "for", "(", "Boolean", "bool", ":", "branches", ")", "{", "if", "(", "bool", "&&", "++", "inBranches", ">", ...
Check if a schema or data record is being passed to more than one branches.
[ "Check", "if", "a", "schema", "or", "data", "record", "is", "being", "passed", "to", "more", "than", "one", "branches", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/Task.java#L812-L820
25,810
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/Task.java
Task.cancel
public synchronized boolean cancel() { if (this.taskFuture != null && this.taskFuture.cancel(true)) { this.taskStateTracker.onTaskRunCompletion(this); this.completeShutdown(); return true; } else { return false; } }
java
public synchronized boolean cancel() { if (this.taskFuture != null && this.taskFuture.cancel(true)) { this.taskStateTracker.onTaskRunCompletion(this); this.completeShutdown(); return true; } else { return false; } }
[ "public", "synchronized", "boolean", "cancel", "(", ")", "{", "if", "(", "this", ".", "taskFuture", "!=", "null", "&&", "this", ".", "taskFuture", ".", "cancel", "(", "true", ")", ")", "{", "this", ".", "taskStateTracker", ".", "onTaskRunCompletion", "(", ...
return true if the task is successfully cancelled. @return
[ "return", "true", "if", "the", "task", "is", "successfully", "cancelled", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/Task.java#L1012-L1020
25,811
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaAvroExtractor.java
KafkaAvroExtractor.convertRecord
@Override protected GenericRecord convertRecord(GenericRecord record) throws IOException { return AvroUtils.convertRecordSchema(record, this.schema.get()); }
java
@Override protected GenericRecord convertRecord(GenericRecord record) throws IOException { return AvroUtils.convertRecordSchema(record, this.schema.get()); }
[ "@", "Override", "protected", "GenericRecord", "convertRecord", "(", "GenericRecord", "record", ")", "throws", "IOException", "{", "return", "AvroUtils", ".", "convertRecordSchema", "(", "record", ",", "this", ".", "schema", ".", "get", "(", ")", ")", ";", "}"...
Convert the record to the output schema of this extractor @param record the input record @return the converted record @throws IOException
[ "Convert", "the", "record", "to", "the", "output", "schema", "of", "this", "extractor" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaAvroExtractor.java#L130-L133
25,812
apache/incubator-gobblin
gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/zip/ZipFileConfigStore.java
ZipFileConfigStore.getDatasetDirForKey
private Path getDatasetDirForKey(ConfigKeyPath configKey) throws VersionDoesNotExistException { return this.fs.getPath(this.storePrefix, configKey.getAbsolutePathString()); }
java
private Path getDatasetDirForKey(ConfigKeyPath configKey) throws VersionDoesNotExistException { return this.fs.getPath(this.storePrefix, configKey.getAbsolutePathString()); }
[ "private", "Path", "getDatasetDirForKey", "(", "ConfigKeyPath", "configKey", ")", "throws", "VersionDoesNotExistException", "{", "return", "this", ".", "fs", ".", "getPath", "(", "this", ".", "storePrefix", ",", "configKey", ".", "getAbsolutePathString", "(", ")", ...
Get path object using zipped file system and relative path
[ "Get", "path", "object", "using", "zipped", "file", "system", "and", "relative", "path" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-config-management/gobblin-config-core/src/main/java/org/apache/gobblin/config/store/zip/ZipFileConfigStore.java#L196-L198
25,813
apache/incubator-gobblin
gobblin-modules/gobblin-service-kafka/src/main/java/org/apache/gobblin/service/StreamingKafkaSpecConsumer.java
StreamingKafkaSpecConsumer.changedSpecs
@Override public Future<? extends List<Pair<SpecExecutor.Verb, Spec>>> changedSpecs() { List<Pair<SpecExecutor.Verb, Spec>> changesSpecs = new ArrayList<>(); try { Pair<SpecExecutor.Verb, Spec> specPair = _jobSpecQueue.take(); _metrics.jobSpecDeqCount.incrementAndGet(); do { changes...
java
@Override public Future<? extends List<Pair<SpecExecutor.Verb, Spec>>> changedSpecs() { List<Pair<SpecExecutor.Verb, Spec>> changesSpecs = new ArrayList<>(); try { Pair<SpecExecutor.Verb, Spec> specPair = _jobSpecQueue.take(); _metrics.jobSpecDeqCount.incrementAndGet(); do { changes...
[ "@", "Override", "public", "Future", "<", "?", "extends", "List", "<", "Pair", "<", "SpecExecutor", ".", "Verb", ",", "Spec", ">", ">", ">", "changedSpecs", "(", ")", "{", "List", "<", "Pair", "<", "SpecExecutor", ".", "Verb", ",", "Spec", ">", ">", ...
This method returns job specs receive from Kafka. It will block if there are no job specs. @return list of (verb, jobspecs) pairs.
[ "This", "method", "returns", "job", "specs", "receive", "from", "Kafka", ".", "It", "will", "block", "if", "there", "are", "no", "job", "specs", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-service-kafka/src/main/java/org/apache/gobblin/service/StreamingKafkaSpecConsumer.java#L108-L126
25,814
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/InnerMetricContext.java
InnerMetricContext.remove
@Override public synchronized boolean remove(String name) { MetricContext metricContext = this.metricContext.get(); if (metricContext != null) { metricContext.removeFromMetrics(this.contextAwareMetrics.get(name).getContextAwareMetric()); } return this.contextAwareMetrics.remove(name) != null && ...
java
@Override public synchronized boolean remove(String name) { MetricContext metricContext = this.metricContext.get(); if (metricContext != null) { metricContext.removeFromMetrics(this.contextAwareMetrics.get(name).getContextAwareMetric()); } return this.contextAwareMetrics.remove(name) != null && ...
[ "@", "Override", "public", "synchronized", "boolean", "remove", "(", "String", "name", ")", "{", "MetricContext", "metricContext", "=", "this", ".", "metricContext", ".", "get", "(", ")", ";", "if", "(", "metricContext", "!=", "null", ")", "{", "metricContex...
Remove a metric with a given name. <p> This method will remove the metric with the given name from this {@link MetricContext} as well as metrics with the same name from every child {@link MetricContext}s. </p> @param name name of the metric to be removed @return whether or not the metric has been removed
[ "Remove", "a", "metric", "with", "a", "given", "name", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/InnerMetricContext.java#L299-L306
25,815
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/watermark/SimpleWatermark.java
SimpleWatermark.getInterval
private static long getInterval(long lowWatermarkValue, long highWatermarkValue, long partitionInterval, int maxIntervals) { if (lowWatermarkValue > highWatermarkValue) { LOG.info( "lowWatermarkValue: " + lowWatermarkValue + " is greater than highWatermarkValue: " + highWatermarkValue); ...
java
private static long getInterval(long lowWatermarkValue, long highWatermarkValue, long partitionInterval, int maxIntervals) { if (lowWatermarkValue > highWatermarkValue) { LOG.info( "lowWatermarkValue: " + lowWatermarkValue + " is greater than highWatermarkValue: " + highWatermarkValue); ...
[ "private", "static", "long", "getInterval", "(", "long", "lowWatermarkValue", ",", "long", "highWatermarkValue", ",", "long", "partitionInterval", ",", "int", "maxIntervals", ")", "{", "if", "(", "lowWatermarkValue", ">", "highWatermarkValue", ")", "{", "LOG", "."...
recalculate interval if total number of partitions greater than maximum number of allowed partitions @param lowWatermarkValue low watermark value @param highWatermarkValue high watermark value @param partitionInterval partition interval @param maxIntervals max number of allowed partitions @return calculated interval
[ "recalculate", "interval", "if", "total", "number", "of", "partitions", "greater", "than", "maximum", "number", "of", "allowed", "partitions" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/watermark/SimpleWatermark.java#L94-L118
25,816
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/ScheduledReporter.java
ScheduledReporter.report
protected void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers, Map<String, Object> tags, boolean isFinal) { report(gauges, counters, histograms, meters, timers, tags); ...
java
protected void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers, Map<String, Object> tags, boolean isFinal) { report(gauges, counters, histograms, meters, timers, tags); ...
[ "protected", "void", "report", "(", "SortedMap", "<", "String", ",", "Gauge", ">", "gauges", ",", "SortedMap", "<", "String", ",", "Counter", ">", "counters", ",", "SortedMap", "<", "String", ",", "Histogram", ">", "histograms", ",", "SortedMap", "<", "Str...
Report the input metrics. The input tags apply to all input metrics. <p> The default implementation of this method is to ignore the value of isFinal. Sub-classes that are interested in using the value of isFinal should override this method as well as {@link #report(SortedMap, SortedMap, SortedMap, SortedMap, SortedMap...
[ "Report", "the", "input", "metrics", ".", "The", "input", "tags", "apply", "to", "all", "input", "metrics", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/reporter/ScheduledReporter.java#L229-L233
25,817
apache/incubator-gobblin
gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-client/src/main/java/org/apache/gobblin/util/limiter/BatchedPermitsRequester.java
BatchedPermitsRequester.getPermits
public boolean getPermits(long permits) throws InterruptedException { if (permits <= 0) { return true; } long startTimeNanos = System.nanoTime(); this.permitsOutstanding.addEntryWithWeight(permits); this.lock.lock(); try { while (true) { if (permits >= this.knownUnsatisfiable...
java
public boolean getPermits(long permits) throws InterruptedException { if (permits <= 0) { return true; } long startTimeNanos = System.nanoTime(); this.permitsOutstanding.addEntryWithWeight(permits); this.lock.lock(); try { while (true) { if (permits >= this.knownUnsatisfiable...
[ "public", "boolean", "getPermits", "(", "long", "permits", ")", "throws", "InterruptedException", "{", "if", "(", "permits", "<=", "0", ")", "{", "return", "true", ";", "}", "long", "startTimeNanos", "=", "System", ".", "nanoTime", "(", ")", ";", "this", ...
Try to get a number of permits from this requester. @return true if permits were obtained successfully.
[ "Try", "to", "get", "a", "number", "of", "permits", "from", "this", "requester", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-client/src/main/java/org/apache/gobblin/util/limiter/BatchedPermitsRequester.java#L148-L186
25,818
apache/incubator-gobblin
gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-client/src/main/java/org/apache/gobblin/util/limiter/BatchedPermitsRequester.java
BatchedPermitsRequester.maybeSendNewPermitRequest
private void maybeSendNewPermitRequest() { if (!this.requestSemaphore.tryAcquire()) { return; } if (!this.retryStatus.canRetryNow()) { this.requestSemaphore.release(); return; } try { long permits = computeNextPermitRequest(); if (permits <= 0) { this.requestSem...
java
private void maybeSendNewPermitRequest() { if (!this.requestSemaphore.tryAcquire()) { return; } if (!this.retryStatus.canRetryNow()) { this.requestSemaphore.release(); return; } try { long permits = computeNextPermitRequest(); if (permits <= 0) { this.requestSem...
[ "private", "void", "maybeSendNewPermitRequest", "(", ")", "{", "if", "(", "!", "this", ".", "requestSemaphore", ".", "tryAcquire", "(", ")", ")", "{", "return", ";", "}", "if", "(", "!", "this", ".", "retryStatus", ".", "canRetryNow", "(", ")", ")", "{...
Send a new permit request to the server.
[ "Send", "a", "new", "permit", "request", "to", "the", "server", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-throttling-service/gobblin-throttling-service-client/src/main/java/org/apache/gobblin/util/limiter/BatchedPermitsRequester.java#L199-L232
25,819
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/RateControlledFileSystem.java
RateControlledFileSystem.getRateIfRateControlled
public static Optional<Long> getRateIfRateControlled(FileSystem fs) { if (fs instanceof Decorator) { List<Object> lineage = DecoratorUtils.getDecoratorLineage(fs); for (Object obj : lineage) { if (obj instanceof RateControlledFileSystem) { return Optional.of(((RateControlledFileSystem)...
java
public static Optional<Long> getRateIfRateControlled(FileSystem fs) { if (fs instanceof Decorator) { List<Object> lineage = DecoratorUtils.getDecoratorLineage(fs); for (Object obj : lineage) { if (obj instanceof RateControlledFileSystem) { return Optional.of(((RateControlledFileSystem)...
[ "public", "static", "Optional", "<", "Long", ">", "getRateIfRateControlled", "(", "FileSystem", "fs", ")", "{", "if", "(", "fs", "instanceof", "Decorator", ")", "{", "List", "<", "Object", ">", "lineage", "=", "DecoratorUtils", ".", "getDecoratorLineage", "(",...
Determines whether the file system is rate controlled, and if so, returns the allowed rate in operations per second. @param fs {@link FileSystem} to check for rate control. @return {@link Optional#absent} if file system is not rate controlled, otherwise, the rate in operations per second.
[ "Determines", "whether", "the", "file", "system", "is", "rate", "controlled", "and", "if", "so", "returns", "the", "allowed", "rate", "in", "operations", "per", "second", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/RateControlledFileSystem.java#L67-L78
25,820
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/std/DefaultJobSpecScheduleImpl.java
DefaultJobSpecScheduleImpl.createImmediateSchedule
public static DefaultJobSpecScheduleImpl createImmediateSchedule(JobSpec jobSpec, Runnable jobRunnable) { return new DefaultJobSpecScheduleImpl(jobSpec, jobRunnable, Optional.of(System.currentTimeMillis()));...
java
public static DefaultJobSpecScheduleImpl createImmediateSchedule(JobSpec jobSpec, Runnable jobRunnable) { return new DefaultJobSpecScheduleImpl(jobSpec, jobRunnable, Optional.of(System.currentTimeMillis()));...
[ "public", "static", "DefaultJobSpecScheduleImpl", "createImmediateSchedule", "(", "JobSpec", "jobSpec", ",", "Runnable", "jobRunnable", ")", "{", "return", "new", "DefaultJobSpecScheduleImpl", "(", "jobSpec", ",", "jobRunnable", ",", "Optional", ".", "of", "(", "Syste...
Creates a schedule denoting that the job is to be executed immediately
[ "Creates", "a", "schedule", "denoting", "that", "the", "job", "is", "to", "be", "executed", "immediately" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/std/DefaultJobSpecScheduleImpl.java#L36-L40
25,821
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/std/DefaultJobSpecScheduleImpl.java
DefaultJobSpecScheduleImpl.createNoSchedule
public static DefaultJobSpecScheduleImpl createNoSchedule(JobSpec jobSpec, Runnable jobRunnable) { return new DefaultJobSpecScheduleImpl(jobSpec, jobRunnable, Optional.<Long>absent()); }
java
public static DefaultJobSpecScheduleImpl createNoSchedule(JobSpec jobSpec, Runnable jobRunnable) { return new DefaultJobSpecScheduleImpl(jobSpec, jobRunnable, Optional.<Long>absent()); }
[ "public", "static", "DefaultJobSpecScheduleImpl", "createNoSchedule", "(", "JobSpec", "jobSpec", ",", "Runnable", "jobRunnable", ")", "{", "return", "new", "DefaultJobSpecScheduleImpl", "(", "jobSpec", ",", "jobRunnable", ",", "Optional", ".", "<", "Long", ">", "abs...
Creates a schedule denoting that the job is not to be executed
[ "Creates", "a", "schedule", "denoting", "that", "the", "job", "is", "not", "to", "be", "executed" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/std/DefaultJobSpecScheduleImpl.java#L43-L47
25,822
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveCopyEntityHelper.java
HiveCopyEntityHelper.getTargetLocation
Path getTargetLocation(FileSystem sourceFs, FileSystem targetFs, Path path, Optional<Partition> partition) throws IOException { return getTargetPathHelper().getTargetPath(path, targetFs, partition, false); }
java
Path getTargetLocation(FileSystem sourceFs, FileSystem targetFs, Path path, Optional<Partition> partition) throws IOException { return getTargetPathHelper().getTargetPath(path, targetFs, partition, false); }
[ "Path", "getTargetLocation", "(", "FileSystem", "sourceFs", ",", "FileSystem", "targetFs", ",", "Path", "path", ",", "Optional", "<", "Partition", ">", "partition", ")", "throws", "IOException", "{", "return", "getTargetPathHelper", "(", ")", ".", "getTargetPath",...
Compute the target location for a Hive location. @param sourceFs Source {@link FileSystem}. @param path source {@link Path} in Hive location. @param partition partition these paths correspond to. @return transformed location in the target. @throws IOException if cannot generate a single target location.
[ "Compute", "the", "target", "location", "for", "a", "Hive", "location", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveCopyEntityHelper.java#L780-L783
25,823
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/DownloadUtils.java
DownloadUtils.getIvySettingsFile
public static File getIvySettingsFile() throws IOException { URL settingsUrl = Thread.currentThread().getContextClassLoader().getResource(IVY_SETTINGS_FILE_NAME); if (settingsUrl == null) { throw new IOException("Failed to find " + IVY_SETTINGS_FILE_NAME + " from class path"); } // Check if setti...
java
public static File getIvySettingsFile() throws IOException { URL settingsUrl = Thread.currentThread().getContextClassLoader().getResource(IVY_SETTINGS_FILE_NAME); if (settingsUrl == null) { throw new IOException("Failed to find " + IVY_SETTINGS_FILE_NAME + " from class path"); } // Check if setti...
[ "public", "static", "File", "getIvySettingsFile", "(", ")", "throws", "IOException", "{", "URL", "settingsUrl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ".", "getResource", "(", "IVY_SETTINGS_FILE_NAME", ")", ";", "i...
Get ivy settings file from classpath
[ "Get", "ivy", "settings", "file", "from", "classpath" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/DownloadUtils.java#L73-L95
25,824
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java
DataWriterBuilder.writeTo
public DataWriterBuilder<S, D> writeTo(Destination destination) { this.destination = destination; log.debug("For destination: {}", destination); return this; }
java
public DataWriterBuilder<S, D> writeTo(Destination destination) { this.destination = destination; log.debug("For destination: {}", destination); return this; }
[ "public", "DataWriterBuilder", "<", "S", ",", "D", ">", "writeTo", "(", "Destination", "destination", ")", "{", "this", ".", "destination", "=", "destination", ";", "log", ".", "debug", "(", "\"For destination: {}\"", ",", "destination", ")", ";", "return", ...
Tell the writer the destination to write to. @param destination destination to write to @return this {@link DataWriterBuilder} instance
[ "Tell", "the", "writer", "the", "destination", "to", "write", "to", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java#L57-L61
25,825
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java
DataWriterBuilder.withWriterId
public DataWriterBuilder<S, D> withWriterId(String writerId) { this.writerId = writerId; log.debug("withWriterId : {}", this.writerId); return this; }
java
public DataWriterBuilder<S, D> withWriterId(String writerId) { this.writerId = writerId; log.debug("withWriterId : {}", this.writerId); return this; }
[ "public", "DataWriterBuilder", "<", "S", ",", "D", ">", "withWriterId", "(", "String", "writerId", ")", "{", "this", ".", "writerId", "=", "writerId", ";", "log", ".", "debug", "(", "\"withWriterId : {}\"", ",", "this", ".", "writerId", ")", ";", "return",...
Give the writer a unique ID. @param writerId unique writer ID @return this {@link DataWriterBuilder} instance
[ "Give", "the", "writer", "a", "unique", "ID", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java#L81-L85
25,826
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java
DataWriterBuilder.withSchema
public DataWriterBuilder<S, D> withSchema(S schema) { this.schema = schema; log.debug("withSchema : {}", this.schema); return this; }
java
public DataWriterBuilder<S, D> withSchema(S schema) { this.schema = schema; log.debug("withSchema : {}", this.schema); return this; }
[ "public", "DataWriterBuilder", "<", "S", ",", "D", ">", "withSchema", "(", "S", "schema", ")", "{", "this", ".", "schema", "=", "schema", ";", "log", ".", "debug", "(", "\"withSchema : {}\"", ",", "this", ".", "schema", ")", ";", "return", "this", ";",...
Tell the writer the data schema. @param schema data schema @return this {@link DataWriterBuilder} instance
[ "Tell", "the", "writer", "the", "data", "schema", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java#L93-L97
25,827
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java
DataWriterBuilder.withBranches
public DataWriterBuilder<S, D> withBranches(int branches) { this.branches = branches; log.debug("With branches: {}", this.branches); return this; }
java
public DataWriterBuilder<S, D> withBranches(int branches) { this.branches = branches; log.debug("With branches: {}", this.branches); return this; }
[ "public", "DataWriterBuilder", "<", "S", ",", "D", ">", "withBranches", "(", "int", "branches", ")", "{", "this", ".", "branches", "=", "branches", ";", "log", ".", "debug", "(", "\"With branches: {}\"", ",", "this", ".", "branches", ")", ";", "return", ...
Tell the writer how many branches are being used. @param branches is the number of branches @return this {@link DataWriterBuilder} instance
[ "Tell", "the", "writer", "how", "many", "branches", "are", "being", "used", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java#L105-L109
25,828
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java
DataWriterBuilder.forBranch
public DataWriterBuilder<S, D> forBranch(int branch) { this.branch = branch; log.debug("For branch: {}", this.branch); return this; }
java
public DataWriterBuilder<S, D> forBranch(int branch) { this.branch = branch; log.debug("For branch: {}", this.branch); return this; }
[ "public", "DataWriterBuilder", "<", "S", ",", "D", ">", "forBranch", "(", "int", "branch", ")", "{", "this", ".", "branch", "=", "branch", ";", "log", ".", "debug", "(", "\"For branch: {}\"", ",", "this", ".", "branch", ")", ";", "return", "this", ";",...
Tell the writer which branch it is associated with. @param branch branch index @return this {@link DataWriterBuilder} instance
[ "Tell", "the", "writer", "which", "branch", "it", "is", "associated", "with", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/writer/DataWriterBuilder.java#L117-L121
25,829
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/avro/HiveAvroCopyEntityHelper.java
HiveAvroCopyEntityHelper.isHiveTableAvroType
public static boolean isHiveTableAvroType(Table targetTable) throws IOException { String serializationLib = targetTable.getTTable().getSd().getSerdeInfo().getSerializationLib(); String inputFormat = targetTable.getTTable().getSd().getInputFormat(); String outputFormat = targetTable.getTTable().getSd().getOu...
java
public static boolean isHiveTableAvroType(Table targetTable) throws IOException { String serializationLib = targetTable.getTTable().getSd().getSerdeInfo().getSerializationLib(); String inputFormat = targetTable.getTTable().getSd().getInputFormat(); String outputFormat = targetTable.getTTable().getSd().getOu...
[ "public", "static", "boolean", "isHiveTableAvroType", "(", "Table", "targetTable", ")", "throws", "IOException", "{", "String", "serializationLib", "=", "targetTable", ".", "getTTable", "(", ")", ".", "getSd", "(", ")", ".", "getSerdeInfo", "(", ")", ".", "get...
Tell whether a hive table is actually an Avro table @param targetTable @return @throws IOException
[ "Tell", "whether", "a", "hive", "table", "is", "actually", "an", "Avro", "table" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/avro/HiveAvroCopyEntityHelper.java#L103-L110
25,830
apache/incubator-gobblin
gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java
HivePurgerQueryTemplate.getCreateTableQuery
public static String getCreateTableQuery(String completeNewTableName, String likeTableDbName, String likeTableName, String location) { return getCreateTableQuery(completeNewTableName, likeTableDbName, likeTableName) + " LOCATION " + PartitionUtils .getQuotedString(location); }
java
public static String getCreateTableQuery(String completeNewTableName, String likeTableDbName, String likeTableName, String location) { return getCreateTableQuery(completeNewTableName, likeTableDbName, likeTableName) + " LOCATION " + PartitionUtils .getQuotedString(location); }
[ "public", "static", "String", "getCreateTableQuery", "(", "String", "completeNewTableName", ",", "String", "likeTableDbName", ",", "String", "likeTableName", ",", "String", "location", ")", "{", "return", "getCreateTableQuery", "(", "completeNewTableName", ",", "likeTab...
If staging table doesn't exist, it will create a staging table.
[ "If", "staging", "table", "doesn", "t", "exist", "it", "will", "create", "a", "staging", "table", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java#L67-L71
25,831
apache/incubator-gobblin
gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java
HivePurgerQueryTemplate.getInsertQuery
public static String getInsertQuery(PurgeableHivePartitionDataset dataset) { return "INSERT OVERWRITE" + " TABLE " + dataset.getCompleteStagingTableName() + " PARTITION (" + PartitionUtils .getPartitionSpecString(dataset.getSpec()) + ")" + " SELECT /*+MAPJOIN(b) */ " + getCommaSeparatedColumnNames( ...
java
public static String getInsertQuery(PurgeableHivePartitionDataset dataset) { return "INSERT OVERWRITE" + " TABLE " + dataset.getCompleteStagingTableName() + " PARTITION (" + PartitionUtils .getPartitionSpecString(dataset.getSpec()) + ")" + " SELECT /*+MAPJOIN(b) */ " + getCommaSeparatedColumnNames( ...
[ "public", "static", "String", "getInsertQuery", "(", "PurgeableHivePartitionDataset", "dataset", ")", "{", "return", "\"INSERT OVERWRITE\"", "+", "\" TABLE \"", "+", "dataset", ".", "getCompleteStagingTableName", "(", ")", "+", "\" PARTITION (\"", "+", "PartitionUtils", ...
This query will create a partition in staging table and insert the datasets whose compliance id is not contained in the compliance id table.
[ "This", "query", "will", "create", "a", "partition", "in", "staging", "table", "and", "insert", "the", "datasets", "whose", "compliance", "id", "is", "not", "contained", "in", "the", "compliance", "id", "table", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java#L82-L89
25,832
apache/incubator-gobblin
gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java
HivePurgerQueryTemplate.getPurgeQueries
public static List<String> getPurgeQueries(PurgeableHivePartitionDataset dataset) { List<String> queries = new ArrayList<>(); queries.add(getUseDbQuery(dataset.getStagingDb())); queries.add(getInsertQuery(dataset)); return queries; }
java
public static List<String> getPurgeQueries(PurgeableHivePartitionDataset dataset) { List<String> queries = new ArrayList<>(); queries.add(getUseDbQuery(dataset.getStagingDb())); queries.add(getInsertQuery(dataset)); return queries; }
[ "public", "static", "List", "<", "String", ">", "getPurgeQueries", "(", "PurgeableHivePartitionDataset", "dataset", ")", "{", "List", "<", "String", ">", "queries", "=", "new", "ArrayList", "<>", "(", ")", ";", "queries", ".", "add", "(", "getUseDbQuery", "(...
Will return all the queries needed to populate the staging table partition. This won't include alter table partition location query.
[ "Will", "return", "all", "the", "queries", "needed", "to", "populate", "the", "staging", "table", "partition", ".", "This", "won", "t", "include", "alter", "table", "partition", "location", "query", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java#L123-L128
25,833
apache/incubator-gobblin
gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java
HivePurgerQueryTemplate.getBackupQueries
public static List<String> getBackupQueries(PurgeableHivePartitionDataset dataset) { List<String> queries = new ArrayList<>(); queries.add(getUseDbQuery(dataset.getDbName())); queries.add(getCreateTableQuery(dataset.getCompleteBackupTableName(), dataset.getDbName(), dataset.getTableName(), dataset.g...
java
public static List<String> getBackupQueries(PurgeableHivePartitionDataset dataset) { List<String> queries = new ArrayList<>(); queries.add(getUseDbQuery(dataset.getDbName())); queries.add(getCreateTableQuery(dataset.getCompleteBackupTableName(), dataset.getDbName(), dataset.getTableName(), dataset.g...
[ "public", "static", "List", "<", "String", ">", "getBackupQueries", "(", "PurgeableHivePartitionDataset", "dataset", ")", "{", "List", "<", "String", ">", "queries", "=", "new", "ArrayList", "<>", "(", ")", ";", "queries", ".", "add", "(", "getUseDbQuery", "...
Will return all the queries needed to have a backup table partition pointing to the original partition data location
[ "Will", "return", "all", "the", "queries", "needed", "to", "have", "a", "backup", "table", "partition", "pointing", "to", "the", "original", "partition", "data", "location" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java#L150-L163
25,834
apache/incubator-gobblin
gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java
HivePurgerQueryTemplate.getAlterOriginalPartitionLocationQueries
public static List<String> getAlterOriginalPartitionLocationQueries(PurgeableHivePartitionDataset dataset) { List<String> queries = new ArrayList<>(); queries.add(getUseDbQuery(dataset.getDbName())); String partitionSpecString = PartitionUtils.getPartitionSpecString(dataset.getSpec()); queries.add( ...
java
public static List<String> getAlterOriginalPartitionLocationQueries(PurgeableHivePartitionDataset dataset) { List<String> queries = new ArrayList<>(); queries.add(getUseDbQuery(dataset.getDbName())); String partitionSpecString = PartitionUtils.getPartitionSpecString(dataset.getSpec()); queries.add( ...
[ "public", "static", "List", "<", "String", ">", "getAlterOriginalPartitionLocationQueries", "(", "PurgeableHivePartitionDataset", "dataset", ")", "{", "List", "<", "String", ">", "queries", "=", "new", "ArrayList", "<>", "(", ")", ";", "queries", ".", "add", "("...
Will return all the queries needed to alter the location of the table partition. Alter table partition query doesn't work with syntax dbName.tableName
[ "Will", "return", "all", "the", "queries", "needed", "to", "alter", "the", "location", "of", "the", "table", "partition", ".", "Alter", "table", "partition", "query", "doesn", "t", "work", "with", "syntax", "dbName", ".", "tableName" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-compliance/src/main/java/org/apache/gobblin/compliance/purger/HivePurgerQueryTemplate.java#L169-L177
25,835
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/converter/EnvelopePayloadConverter.java
EnvelopePayloadConverter.convertFieldSchema
protected Field convertFieldSchema(Schema inputSchema, Field field, WorkUnitState workUnit) throws SchemaConversionException { if (field.name().equals(payloadField)) { // Create a payload field with latest schema return createLatestPayloadField(field); } // Make a copy of the field to the ...
java
protected Field convertFieldSchema(Schema inputSchema, Field field, WorkUnitState workUnit) throws SchemaConversionException { if (field.name().equals(payloadField)) { // Create a payload field with latest schema return createLatestPayloadField(field); } // Make a copy of the field to the ...
[ "protected", "Field", "convertFieldSchema", "(", "Schema", "inputSchema", ",", "Field", "field", ",", "WorkUnitState", "workUnit", ")", "throws", "SchemaConversionException", "{", "if", "(", "field", ".", "name", "(", ")", ".", "equals", "(", "payloadField", ")"...
Convert to the output schema of a field
[ "Convert", "to", "the", "output", "schema", "of", "a", "field" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/converter/EnvelopePayloadConverter.java#L66-L74
25,836
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/converter/EnvelopePayloadConverter.java
EnvelopePayloadConverter.convertFieldValue
protected Object convertFieldValue(Schema outputSchema, Field field, GenericRecord inputRecord, WorkUnitState workUnit) throws DataConversionException { if (field.name().equals(payloadField)) { return upConvertPayload(inputRecord); } return inputRecord.get(field.name()); }
java
protected Object convertFieldValue(Schema outputSchema, Field field, GenericRecord inputRecord, WorkUnitState workUnit) throws DataConversionException { if (field.name().equals(payloadField)) { return upConvertPayload(inputRecord); } return inputRecord.get(field.name()); }
[ "protected", "Object", "convertFieldValue", "(", "Schema", "outputSchema", ",", "Field", "field", ",", "GenericRecord", "inputRecord", ",", "WorkUnitState", "workUnit", ")", "throws", "DataConversionException", "{", "if", "(", "field", ".", "name", "(", ")", ".", ...
Convert to the output value of a field
[ "Convert", "to", "the", "output", "value", "of", "a", "field" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/converter/EnvelopePayloadConverter.java#L105-L112
25,837
apache/incubator-gobblin
gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleAnalyticsUnsampledExtractor.java
GoogleAnalyticsUnsampledExtractor.convertFormat
private String convertFormat(long watermark) { Preconditions.checkArgument(watermark > 0, "Watermark should be positive number."); return googleAnalyticsFormatter.print(watermarkFormatter.parseDateTime(Long.toString(watermark))); }
java
private String convertFormat(long watermark) { Preconditions.checkArgument(watermark > 0, "Watermark should be positive number."); return googleAnalyticsFormatter.print(watermarkFormatter.parseDateTime(Long.toString(watermark))); }
[ "private", "String", "convertFormat", "(", "long", "watermark", ")", "{", "Preconditions", ".", "checkArgument", "(", "watermark", ">", "0", ",", "\"Watermark should be positive number.\"", ")", ";", "return", "googleAnalyticsFormatter", ".", "print", "(", "watermarkF...
Converts date format from watermark format to Google analytics format @param watermark @return
[ "Converts", "date", "format", "from", "watermark", "format", "to", "Google", "analytics", "format" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/source/extractor/extract/google/GoogleAnalyticsUnsampledExtractor.java#L295-L298
25,838
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/ParallelRunner.java
ParallelRunner.submitCallable
public void submitCallable(Callable<Void> callable, String name) { this.futures.add(new NamedFuture(this.executor.submit(callable), name)); }
java
public void submitCallable(Callable<Void> callable, String name) { this.futures.add(new NamedFuture(this.executor.submit(callable), name)); }
[ "public", "void", "submitCallable", "(", "Callable", "<", "Void", ">", "callable", ",", "String", "name", ")", "{", "this", ".", "futures", ".", "add", "(", "new", "NamedFuture", "(", "this", ".", "executor", ".", "submit", "(", "callable", ")", ",", "...
Submit a callable to the thread pool <p> This method submits a task and returns immediately </p> @param callable the callable to submit @param name for the future
[ "Submit", "a", "callable", "to", "the", "thread", "pool" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ParallelRunner.java#L349-L351
25,839
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/writer/SimpleDataWriter.java
SimpleDataWriter.write
@Override public void write(byte[] record) throws IOException { Preconditions.checkNotNull(record); byte[] toWrite = record; if (this.recordDelimiter.isPresent()) { toWrite = Arrays.copyOf(record, record.length + 1); toWrite[toWrite.length - 1] = this.recordDelimiter.get(); } if (this...
java
@Override public void write(byte[] record) throws IOException { Preconditions.checkNotNull(record); byte[] toWrite = record; if (this.recordDelimiter.isPresent()) { toWrite = Arrays.copyOf(record, record.length + 1); toWrite[toWrite.length - 1] = this.recordDelimiter.get(); } if (this...
[ "@", "Override", "public", "void", "write", "(", "byte", "[", "]", "record", ")", "throws", "IOException", "{", "Preconditions", ".", "checkNotNull", "(", "record", ")", ";", "byte", "[", "]", "toWrite", "=", "record", ";", "if", "(", "this", ".", "rec...
Write a source record to the staging file @param record data record to write @throws java.io.IOException if there is anything wrong writing the record
[ "Write", "a", "source", "record", "to", "the", "staging", "file" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/writer/SimpleDataWriter.java#L85-L103
25,840
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/ProxiedTrash.java
ProxiedTrash.moveToTrashAsUser
@Override public boolean moveToTrashAsUser(Path path, final String user) throws IOException { return getUserTrash(user).moveToTrash(path); }
java
@Override public boolean moveToTrashAsUser(Path path, final String user) throws IOException { return getUserTrash(user).moveToTrash(path); }
[ "@", "Override", "public", "boolean", "moveToTrashAsUser", "(", "Path", "path", ",", "final", "String", "user", ")", "throws", "IOException", "{", "return", "getUserTrash", "(", "user", ")", ".", "moveToTrash", "(", "path", ")", ";", "}" ]
Move the path to trash as specified user. @param path {@link org.apache.hadoop.fs.Path} to move. @param user User to move the path as. @return true if the move succeeded. @throws IOException
[ "Move", "the", "path", "to", "trash", "as", "specified", "user", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/ProxiedTrash.java#L61-L64
25,841
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/ProxiedTrash.java
ProxiedTrash.moveToTrashAsOwner
public boolean moveToTrashAsOwner(Path path) throws IOException { String owner = this.fs.getFileStatus(path).getOwner(); return moveToTrashAsUser(path, owner); }
java
public boolean moveToTrashAsOwner(Path path) throws IOException { String owner = this.fs.getFileStatus(path).getOwner(); return moveToTrashAsUser(path, owner); }
[ "public", "boolean", "moveToTrashAsOwner", "(", "Path", "path", ")", "throws", "IOException", "{", "String", "owner", "=", "this", ".", "fs", ".", "getFileStatus", "(", "path", ")", ".", "getOwner", "(", ")", ";", "return", "moveToTrashAsUser", "(", "path", ...
Move the path to trash as the owner of the path. @param path {@link org.apache.hadoop.fs.Path} to move. @return true if the move succeeded. @throws IOException
[ "Move", "the", "path", "to", "trash", "as", "the", "owner", "of", "the", "path", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/ProxiedTrash.java#L72-L75
25,842
apache/incubator-gobblin
gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/example/ReporterExampleBase.java
ReporterExampleBase.run
public void run() throws Exception { try { CountDownLatch countDownLatch = new CountDownLatch(this.tasks); for (int i = 0; i < this.tasks; i++) { addTask(i, countDownLatch); } // Wait for the tasks to finish countDownLatch.await(); } finally { try { // Callin...
java
public void run() throws Exception { try { CountDownLatch countDownLatch = new CountDownLatch(this.tasks); for (int i = 0; i < this.tasks; i++) { addTask(i, countDownLatch); } // Wait for the tasks to finish countDownLatch.await(); } finally { try { // Callin...
[ "public", "void", "run", "(", ")", "throws", "Exception", "{", "try", "{", "CountDownLatch", "countDownLatch", "=", "new", "CountDownLatch", "(", "this", ".", "tasks", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "tasks", "...
Run the example.
[ "Run", "the", "example", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/example/ReporterExampleBase.java#L97-L114
25,843
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/logs/LogCopier.java
LogCopier.checkSrcLogFiles
private void checkSrcLogFiles() throws IOException { List<FileStatus> srcLogFiles = new ArrayList<>(); for (Path logDirPath: this.srcLogDirs) { srcLogFiles.addAll(FileListUtils.listFilesRecursively(this.srcFs, logDirPath, new PathFilter() { @Override public boolean accept(Path path) { ...
java
private void checkSrcLogFiles() throws IOException { List<FileStatus> srcLogFiles = new ArrayList<>(); for (Path logDirPath: this.srcLogDirs) { srcLogFiles.addAll(FileListUtils.listFilesRecursively(this.srcFs, logDirPath, new PathFilter() { @Override public boolean accept(Path path) { ...
[ "private", "void", "checkSrcLogFiles", "(", ")", "throws", "IOException", "{", "List", "<", "FileStatus", ">", "srcLogFiles", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Path", "logDirPath", ":", "this", ".", "srcLogDirs", ")", "{", "srcLogF...
Perform a check on new source log files and submit copy tasks for new log files.
[ "Perform", "a", "check", "on", "new", "source", "log", "files", "and", "submit", "copy", "tasks", "for", "new", "log", "files", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/logs/LogCopier.java#L184-L228
25,844
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/WritableShimSerialization.java
WritableShimSerialization.addToHadoopConfiguration
public static void addToHadoopConfiguration(Configuration conf) { final String SERIALIZATION_KEY = "io.serializations"; String existingSerializers = conf.get(SERIALIZATION_KEY); if (existingSerializers != null) { conf.set(SERIALIZATION_KEY, existingSerializers + "," + WritableShimSerialization.class....
java
public static void addToHadoopConfiguration(Configuration conf) { final String SERIALIZATION_KEY = "io.serializations"; String existingSerializers = conf.get(SERIALIZATION_KEY); if (existingSerializers != null) { conf.set(SERIALIZATION_KEY, existingSerializers + "," + WritableShimSerialization.class....
[ "public", "static", "void", "addToHadoopConfiguration", "(", "Configuration", "conf", ")", "{", "final", "String", "SERIALIZATION_KEY", "=", "\"io.serializations\"", ";", "String", "existingSerializers", "=", "conf", ".", "get", "(", "SERIALIZATION_KEY", ")", ";", "...
Helper method to add this serializer to an existing Hadoop config.
[ "Helper", "method", "to", "add", "this", "serializer", "to", "an", "existing", "Hadoop", "config", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/WritableShimSerialization.java#L42-L52
25,845
apache/incubator-gobblin
gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/ingestion/google/webmaster/TrieBasedProducerJob.java
TrieBasedProducerJob.partitionJobs
@Override public List<? extends ProducerJob> partitionJobs() { UrlTrieNode root = _jobNode.getRight(); if (isOperatorEquals() || root.getSize() == 1) { //Either at an Equals-Node or a Leaf-Node, both of which actually has actual size 1. return super.partitionJobs(); } else { if (_groupSi...
java
@Override public List<? extends ProducerJob> partitionJobs() { UrlTrieNode root = _jobNode.getRight(); if (isOperatorEquals() || root.getSize() == 1) { //Either at an Equals-Node or a Leaf-Node, both of which actually has actual size 1. return super.partitionJobs(); } else { if (_groupSi...
[ "@", "Override", "public", "List", "<", "?", "extends", "ProducerJob", ">", "partitionJobs", "(", ")", "{", "UrlTrieNode", "root", "=", "_jobNode", ".", "getRight", "(", ")", ";", "if", "(", "isOperatorEquals", "(", ")", "||", "root", ".", "getSize", "("...
The implementation here will first partition the job by pages, and then by dates. @return
[ "The", "implementation", "here", "will", "first", "partition", "the", "job", "by", "pages", "and", "then", "by", "dates", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/ingestion/google/webmaster/TrieBasedProducerJob.java#L73-L95
25,846
apache/incubator-gobblin
gobblin-modules/gobblin-metrics-influxdb/src/main/java/org/apache/gobblin/metrics/influxdb/InfluxDBPusher.java
InfluxDBPusher.push
public void push(Point point) { BatchPoints.Builder batchPointsBuilder = BatchPoints.database(database).retentionPolicy(DEFAULT_RETENTION_POLICY); batchPointsBuilder.point(point); influxDB.write(batchPointsBuilder.build()); }
java
public void push(Point point) { BatchPoints.Builder batchPointsBuilder = BatchPoints.database(database).retentionPolicy(DEFAULT_RETENTION_POLICY); batchPointsBuilder.point(point); influxDB.write(batchPointsBuilder.build()); }
[ "public", "void", "push", "(", "Point", "point", ")", "{", "BatchPoints", ".", "Builder", "batchPointsBuilder", "=", "BatchPoints", ".", "database", "(", "database", ")", ".", "retentionPolicy", "(", "DEFAULT_RETENTION_POLICY", ")", ";", "batchPointsBuilder", ".",...
Push a single Point @param point the {@link Point} to report
[ "Push", "a", "single", "Point" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-metrics-influxdb/src/main/java/org/apache/gobblin/metrics/influxdb/InfluxDBPusher.java#L86-L90
25,847
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java
KafkaUtils.getPropAsLongFromSingleOrMultiWorkUnitState
public static long getPropAsLongFromSingleOrMultiWorkUnitState(WorkUnitState workUnitState, String key, int partitionId) { return Long.parseLong(workUnitState.contains(key) ? workUnitState.getProp(key) : workUnitState.getProp(KafkaUtils.getPar...
java
public static long getPropAsLongFromSingleOrMultiWorkUnitState(WorkUnitState workUnitState, String key, int partitionId) { return Long.parseLong(workUnitState.contains(key) ? workUnitState.getProp(key) : workUnitState.getProp(KafkaUtils.getPar...
[ "public", "static", "long", "getPropAsLongFromSingleOrMultiWorkUnitState", "(", "WorkUnitState", "workUnitState", ",", "String", "key", ",", "int", "partitionId", ")", "{", "return", "Long", ".", "parseLong", "(", "workUnitState", ".", "contains", "(", "key", ")", ...
Get a property as long from a work unit that may or may not be a multiworkunit. This method is needed because the SingleLevelWorkUnitPacker does not squeeze work units into a multiworkunit, and thus does not append the partitionId to property keys, while the BiLevelWorkUnitPacker does. Return 0 as default if key not fo...
[ "Get", "a", "property", "as", "long", "from", "a", "work", "unit", "that", "may", "or", "may", "not", "be", "a", "multiworkunit", ".", "This", "method", "is", "needed", "because", "the", "SingleLevelWorkUnitPacker", "does", "not", "squeeze", "work", "units",...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaUtils.java#L180-L184
25,848
apache/incubator-gobblin
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java
SalesforceSource.computeTargetPartitionSize
private int computeTargetPartitionSize(Histogram histogram, int minTargetPartitionSize, int maxPartitions) { return Math.max(minTargetPartitionSize, DoubleMath.roundToInt((double) histogram.totalRecordCount / maxPartitions, RoundingMode.CEILING)); }
java
private int computeTargetPartitionSize(Histogram histogram, int minTargetPartitionSize, int maxPartitions) { return Math.max(minTargetPartitionSize, DoubleMath.roundToInt((double) histogram.totalRecordCount / maxPartitions, RoundingMode.CEILING)); }
[ "private", "int", "computeTargetPartitionSize", "(", "Histogram", "histogram", ",", "int", "minTargetPartitionSize", ",", "int", "maxPartitions", ")", "{", "return", "Math", ".", "max", "(", "minTargetPartitionSize", ",", "DoubleMath", ".", "roundToInt", "(", "(", ...
Compute the target partition size.
[ "Compute", "the", "target", "partition", "size", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java#L287-L290
25,849
apache/incubator-gobblin
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java
SalesforceSource.getCountForRange
private int getCountForRange(TableCountProbingContext probingContext, StrSubstitutor sub, Map<String, String> subValues, long startTime, long endTime) { String startTimeStr = Utils.dateToString(new Date(startTime), SalesforceExtractor.SALESFORCE_TIMESTAMP_FORMAT); String endTimeStr = Utils.dateToString(ne...
java
private int getCountForRange(TableCountProbingContext probingContext, StrSubstitutor sub, Map<String, String> subValues, long startTime, long endTime) { String startTimeStr = Utils.dateToString(new Date(startTime), SalesforceExtractor.SALESFORCE_TIMESTAMP_FORMAT); String endTimeStr = Utils.dateToString(ne...
[ "private", "int", "getCountForRange", "(", "TableCountProbingContext", "probingContext", ",", "StrSubstitutor", "sub", ",", "Map", "<", "String", ",", "String", ">", "subValues", ",", "long", "startTime", ",", "long", "endTime", ")", "{", "String", "startTimeStr",...
Get the row count for a time range
[ "Get", "the", "row", "count", "for", "a", "time", "range" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java#L318-L336
25,850
apache/incubator-gobblin
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java
SalesforceSource.getHistogramRecursively
private void getHistogramRecursively(TableCountProbingContext probingContext, Histogram histogram, StrSubstitutor sub, Map<String, String> values, int count, long startEpoch, long endEpoch) { long midpointEpoch = startEpoch + (endEpoch - startEpoch) / 2; // don't split further if small, above the probe l...
java
private void getHistogramRecursively(TableCountProbingContext probingContext, Histogram histogram, StrSubstitutor sub, Map<String, String> values, int count, long startEpoch, long endEpoch) { long midpointEpoch = startEpoch + (endEpoch - startEpoch) / 2; // don't split further if small, above the probe l...
[ "private", "void", "getHistogramRecursively", "(", "TableCountProbingContext", "probingContext", ",", "Histogram", "histogram", ",", "StrSubstitutor", "sub", ",", "Map", "<", "String", ",", "String", ">", "values", ",", "int", "count", ",", "long", "startEpoch", "...
Split a histogram bucket along the midpoint if it is larger than the bucket size limit.
[ "Split", "a", "histogram", "bucket", "along", "the", "midpoint", "if", "it", "is", "larger", "than", "the", "bucket", "size", "limit", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java#L341-L362
25,851
apache/incubator-gobblin
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java
SalesforceSource.getHistogramByProbing
private Histogram getHistogramByProbing(TableCountProbingContext probingContext, int count, long startEpoch, long endEpoch) { Histogram histogram = new Histogram(); Map<String, String> values = new HashMap<>(); values.put("table", probingContext.entity); values.put("column", probingContext.waterm...
java
private Histogram getHistogramByProbing(TableCountProbingContext probingContext, int count, long startEpoch, long endEpoch) { Histogram histogram = new Histogram(); Map<String, String> values = new HashMap<>(); values.put("table", probingContext.entity); values.put("column", probingContext.waterm...
[ "private", "Histogram", "getHistogramByProbing", "(", "TableCountProbingContext", "probingContext", ",", "int", "count", ",", "long", "startEpoch", ",", "long", "endEpoch", ")", "{", "Histogram", "histogram", "=", "new", "Histogram", "(", ")", ";", "Map", "<", "...
Get a histogram for the time range by probing to break down large buckets. Use count instead of querying if it is non-negative.
[ "Get", "a", "histogram", "for", "the", "time", "range", "by", "probing", "to", "break", "down", "large", "buckets", ".", "Use", "count", "instead", "of", "querying", "if", "it", "is", "non", "-", "negative", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java#L368-L382
25,852
apache/incubator-gobblin
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java
SalesforceSource.getRefinedHistogram
private Histogram getRefinedHistogram(SalesforceConnector connector, String entity, String watermarkColumn, SourceState state, Partition partition, Histogram histogram) { final int maxPartitions = state.getPropAsInt(ConfigurationKeys.SOURCE_MAX_NUMBER_OF_PARTITIONS, ConfigurationKeys.DEFAULT_MAX_NUMBE...
java
private Histogram getRefinedHistogram(SalesforceConnector connector, String entity, String watermarkColumn, SourceState state, Partition partition, Histogram histogram) { final int maxPartitions = state.getPropAsInt(ConfigurationKeys.SOURCE_MAX_NUMBER_OF_PARTITIONS, ConfigurationKeys.DEFAULT_MAX_NUMBE...
[ "private", "Histogram", "getRefinedHistogram", "(", "SalesforceConnector", "connector", ",", "String", "entity", ",", "String", "watermarkColumn", ",", "SourceState", "state", ",", "Partition", "partition", ",", "Histogram", "histogram", ")", "{", "final", "int", "m...
Refine the histogram by probing to split large buckets @return the refined histogram
[ "Refine", "the", "histogram", "by", "probing", "to", "split", "large", "buckets" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java#L388-L438
25,853
apache/incubator-gobblin
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java
SalesforceSource.getHistogramByDayBucketing
private Histogram getHistogramByDayBucketing(SalesforceConnector connector, String entity, String watermarkColumn, Partition partition) { Histogram histogram = new Histogram(); Calendar calendar = new GregorianCalendar(); Date startDate = Utils.toDate(partition.getLowWatermark(), Partitioner.WATERMAR...
java
private Histogram getHistogramByDayBucketing(SalesforceConnector connector, String entity, String watermarkColumn, Partition partition) { Histogram histogram = new Histogram(); Calendar calendar = new GregorianCalendar(); Date startDate = Utils.toDate(partition.getLowWatermark(), Partitioner.WATERMAR...
[ "private", "Histogram", "getHistogramByDayBucketing", "(", "SalesforceConnector", "connector", ",", "String", "entity", ",", "String", "watermarkColumn", ",", "Partition", "partition", ")", "{", "Histogram", "histogram", "=", "new", "Histogram", "(", ")", ";", "Cale...
Get a histogram with day granularity buckets.
[ "Get", "a", "histogram", "with", "day", "granularity", "buckets", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java#L443-L487
25,854
apache/incubator-gobblin
gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java
SalesforceSource.getHistogram
private Histogram getHistogram(String entity, String watermarkColumn, SourceState state, Partition partition) { SalesforceConnector connector = getConnector(state); try { if (!connector.connect()) { throw new RuntimeException("Failed to connect."); } } catch (RestApiConnectionExce...
java
private Histogram getHistogram(String entity, String watermarkColumn, SourceState state, Partition partition) { SalesforceConnector connector = getConnector(state); try { if (!connector.connect()) { throw new RuntimeException("Failed to connect."); } } catch (RestApiConnectionExce...
[ "private", "Histogram", "getHistogram", "(", "String", "entity", ",", "String", "watermarkColumn", ",", "SourceState", "state", ",", "Partition", "partition", ")", "{", "SalesforceConnector", "connector", "=", "getConnector", "(", "state", ")", ";", "try", "{", ...
Generate the histogram
[ "Generate", "the", "histogram" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceSource.java#L499-L526
25,855
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/writer/RetryWriter.java
RetryWriter.buildRetryer
private Retryer<Void> buildRetryer(State state) { RetryerBuilder<Void> builder = null; if (writer instanceof Retriable) { builder = ((Retriable) writer).getRetryerBuilder(); } else { builder = createRetryBuilder(state); } if (GobblinMetrics.isEnabled(state)) { final Optional<Meter...
java
private Retryer<Void> buildRetryer(State state) { RetryerBuilder<Void> builder = null; if (writer instanceof Retriable) { builder = ((Retriable) writer).getRetryerBuilder(); } else { builder = createRetryBuilder(state); } if (GobblinMetrics.isEnabled(state)) { final Optional<Meter...
[ "private", "Retryer", "<", "Void", ">", "buildRetryer", "(", "State", "state", ")", "{", "RetryerBuilder", "<", "Void", ">", "builder", "=", "null", ";", "if", "(", "writer", "instanceof", "Retriable", ")", "{", "builder", "=", "(", "(", "Retriable", ")"...
Build Retryer. - If Writer implements Retriable, it will use the RetryerBuilder from the writer. - Otherwise, it will use DEFAULT writer builder. - If Gobblin metrics is enabled, it will emit all failure count in to metrics. @param state @return
[ "Build", "Retryer", ".", "-", "If", "Writer", "implements", "Retriable", "it", "will", "use", "the", "RetryerBuilder", "from", "the", "writer", ".", "-", "Otherwise", "it", "will", "use", "DEFAULT", "writer", "builder", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/writer/RetryWriter.java#L83-L106
25,856
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveUtils.java
HiveUtils.getPartitions
public static List<Partition> getPartitions(IMetaStoreClient client, Table table, Optional<String> filter) throws IOException { return getPartitions(client, table, filter, Optional.<HivePartitionExtendedFilter>absent()); }
java
public static List<Partition> getPartitions(IMetaStoreClient client, Table table, Optional<String> filter) throws IOException { return getPartitions(client, table, filter, Optional.<HivePartitionExtendedFilter>absent()); }
[ "public", "static", "List", "<", "Partition", ">", "getPartitions", "(", "IMetaStoreClient", "client", ",", "Table", "table", ",", "Optional", "<", "String", ">", "filter", ")", "throws", "IOException", "{", "return", "getPartitions", "(", "client", ",", "tabl...
For backward compatibility when PathFilter is injected as a parameter. @param client @param table @param filter @return @throws IOException
[ "For", "backward", "compatibility", "when", "PathFilter", "is", "injected", "as", "a", "parameter", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveUtils.java#L116-L119
25,857
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveUtils.java
HiveUtils.getPaths
public static Set<Path> getPaths(InputFormat<?, ?> inputFormat, Path location) throws IOException { JobConf jobConf = new JobConf(getHadoopConfiguration()); Set<Path> paths = Sets.newHashSet(); FileInputFormat.addInputPaths(jobConf, location.toString()); InputSplit[] splits = inputFormat.getSplits(job...
java
public static Set<Path> getPaths(InputFormat<?, ?> inputFormat, Path location) throws IOException { JobConf jobConf = new JobConf(getHadoopConfiguration()); Set<Path> paths = Sets.newHashSet(); FileInputFormat.addInputPaths(jobConf, location.toString()); InputSplit[] splits = inputFormat.getSplits(job...
[ "public", "static", "Set", "<", "Path", ">", "getPaths", "(", "InputFormat", "<", "?", ",", "?", ">", "inputFormat", ",", "Path", "location", ")", "throws", "IOException", "{", "JobConf", "jobConf", "=", "new", "JobConf", "(", "getHadoopConfiguration", "(", ...
Get paths from a Hive location using the provided input format.
[ "Get", "paths", "from", "a", "Hive", "location", "using", "the", "provided", "input", "format", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/hive/HiveUtils.java#L140-L156
25,858
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/ForkOperatorUtils.java
ForkOperatorUtils.getPathForBranch
public static String getPathForBranch(State state, String path, int numBranches, int branchId) { Preconditions.checkNotNull(state); Preconditions.checkNotNull(path); Preconditions.checkArgument(numBranches >= 0, "The number of branches is expected to be non-negative"); Preconditions.checkArgument(branch...
java
public static String getPathForBranch(State state, String path, int numBranches, int branchId) { Preconditions.checkNotNull(state); Preconditions.checkNotNull(path); Preconditions.checkArgument(numBranches >= 0, "The number of branches is expected to be non-negative"); Preconditions.checkArgument(branch...
[ "public", "static", "String", "getPathForBranch", "(", "State", "state", ",", "String", "path", ",", "int", "numBranches", ",", "int", "branchId", ")", "{", "Preconditions", ".", "checkNotNull", "(", "state", ")", ";", "Preconditions", ".", "checkNotNull", "("...
Get a new path with the given branch name as a sub directory. @param numBranches number of branches (non-negative) @param branchId branch id (non-negative) @return a new path
[ "Get", "a", "new", "path", "with", "the", "given", "branch", "name", "as", "a", "sub", "directory", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ForkOperatorUtils.java#L92-L102
25,859
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/source/HiveSource.java
HiveSource.getCreateTime
protected static long getCreateTime(Table table) { return TimeUnit.MILLISECONDS.convert(table.getTTable().getCreateTime(), TimeUnit.SECONDS); }
java
protected static long getCreateTime(Table table) { return TimeUnit.MILLISECONDS.convert(table.getTTable().getCreateTime(), TimeUnit.SECONDS); }
[ "protected", "static", "long", "getCreateTime", "(", "Table", "table", ")", "{", "return", "TimeUnit", ".", "MILLISECONDS", ".", "convert", "(", "table", ".", "getTTable", "(", ")", ".", "getCreateTime", "(", ")", ",", "TimeUnit", ".", "SECONDS", ")", ";",...
Convert createTime from seconds to milliseconds
[ "Convert", "createTime", "from", "seconds", "to", "milliseconds" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/source/HiveSource.java#L435-L437
25,860
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/source/HiveSource.java
HiveSource.silenceHiveLoggers
private void silenceHiveLoggers() { List<String> loggers = ImmutableList.of("org.apache.hadoop.hive", "org.apache.hive", "hive.ql.parse"); for (String name : loggers) { Logger logger = Logger.getLogger(name); if (logger != null) { logger.setLevel(Level.WARN); } } }
java
private void silenceHiveLoggers() { List<String> loggers = ImmutableList.of("org.apache.hadoop.hive", "org.apache.hive", "hive.ql.parse"); for (String name : loggers) { Logger logger = Logger.getLogger(name); if (logger != null) { logger.setLevel(Level.WARN); } } }
[ "private", "void", "silenceHiveLoggers", "(", ")", "{", "List", "<", "String", ">", "loggers", "=", "ImmutableList", ".", "of", "(", "\"org.apache.hadoop.hive\"", ",", "\"org.apache.hive\"", ",", "\"hive.ql.parse\"", ")", ";", "for", "(", "String", "name", ":", ...
Hive logging is too verbose at INFO level. Currently hive does not have a way to set log level. This is a workaround to set log level to WARN for hive loggers only
[ "Hive", "logging", "is", "too", "verbose", "at", "INFO", "level", ".", "Currently", "hive", "does", "not", "have", "a", "way", "to", "set", "log", "level", ".", "This", "is", "a", "workaround", "to", "set", "log", "level", "to", "WARN", "for", "hive", ...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/source/HiveSource.java#L464-L472
25,861
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java
SafeDatasetCommit.commitDataset
private void commitDataset(Collection<TaskState> taskStates, DataPublisher publisher) { try { publisher.publish(taskStates); } catch (Throwable t) { log.error("Failed to commit dataset", t); setTaskFailureException(taskStates, t); } }
java
private void commitDataset(Collection<TaskState> taskStates, DataPublisher publisher) { try { publisher.publish(taskStates); } catch (Throwable t) { log.error("Failed to commit dataset", t); setTaskFailureException(taskStates, t); } }
[ "private", "void", "commitDataset", "(", "Collection", "<", "TaskState", ">", "taskStates", ",", "DataPublisher", "publisher", ")", "{", "try", "{", "publisher", ".", "publish", "(", "taskStates", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "l...
Commit the output data of a dataset.
[ "Commit", "the", "output", "data", "of", "a", "dataset", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java#L264-L272
25,862
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java
SafeDatasetCommit.canCommitDataset
private boolean canCommitDataset(JobState.DatasetState datasetState) { // Only commit a dataset if 1) COMMIT_ON_PARTIAL_SUCCESS is used, or 2) // COMMIT_ON_FULL_SUCCESS is used and all of the tasks of the dataset have succeeded. return this.jobContext.getJobCommitPolicy() == JobCommitPolicy.COMMIT_ON_PARTIA...
java
private boolean canCommitDataset(JobState.DatasetState datasetState) { // Only commit a dataset if 1) COMMIT_ON_PARTIAL_SUCCESS is used, or 2) // COMMIT_ON_FULL_SUCCESS is used and all of the tasks of the dataset have succeeded. return this.jobContext.getJobCommitPolicy() == JobCommitPolicy.COMMIT_ON_PARTIA...
[ "private", "boolean", "canCommitDataset", "(", "JobState", ".", "DatasetState", "datasetState", ")", "{", "// Only commit a dataset if 1) COMMIT_ON_PARTIAL_SUCCESS is used, or 2)", "// COMMIT_ON_FULL_SUCCESS is used and all of the tasks of the dataset have succeeded.", "return", "this", ...
Check if it is OK to commit the output data of a dataset. <p> A dataset can be committed if and only if any of the following conditions is satisfied: <ul> <li>The {@link JobCommitPolicy#COMMIT_ON_PARTIAL_SUCCESS} policy is used.</li> <li>The {@link JobCommitPolicy#COMMIT_SUCCESSFUL_TASKS} policy is used.</li> <li>The...
[ "Check", "if", "it", "is", "OK", "to", "commit", "the", "output", "data", "of", "a", "dataset", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java#L350-L357
25,863
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java
SafeDatasetCommit.persistDatasetState
private void persistDatasetState(String datasetUrn, JobState.DatasetState datasetState) throws IOException { log.info("Persisting dataset state for dataset " + datasetUrn); this.jobContext.getDatasetStateStore().persistDatasetState(datasetUrn, datasetState); }
java
private void persistDatasetState(String datasetUrn, JobState.DatasetState datasetState) throws IOException { log.info("Persisting dataset state for dataset " + datasetUrn); this.jobContext.getDatasetStateStore().persistDatasetState(datasetUrn, datasetState); }
[ "private", "void", "persistDatasetState", "(", "String", "datasetUrn", ",", "JobState", ".", "DatasetState", "datasetState", ")", "throws", "IOException", "{", "log", ".", "info", "(", "\"Persisting dataset state for dataset \"", "+", "datasetUrn", ")", ";", "this", ...
Persist dataset state of a given dataset identified by the dataset URN.
[ "Persist", "dataset", "state", "of", "a", "given", "dataset", "identified", "by", "the", "dataset", "URN", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/SafeDatasetCommit.java#L415-L419
25,864
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/avro/AvroSchemaManager.java
AvroSchemaManager.getOrGenerateSchemaFile
private Path getOrGenerateSchemaFile(Schema schema) throws IOException { Preconditions.checkNotNull(schema, "Avro Schema should not be null"); String hashedSchema = Hashing.sha256().hashString(schema.toString(), StandardCharsets.UTF_8).toString(); if (!this.schemaPaths.containsKey(hashedSchema)) { ...
java
private Path getOrGenerateSchemaFile(Schema schema) throws IOException { Preconditions.checkNotNull(schema, "Avro Schema should not be null"); String hashedSchema = Hashing.sha256().hashString(schema.toString(), StandardCharsets.UTF_8).toString(); if (!this.schemaPaths.containsKey(hashedSchema)) { ...
[ "private", "Path", "getOrGenerateSchemaFile", "(", "Schema", "schema", ")", "throws", "IOException", "{", "Preconditions", ".", "checkNotNull", "(", "schema", ",", "\"Avro Schema should not be null\"", ")", ";", "String", "hashedSchema", "=", "Hashing", ".", "sha256",...
If url for schema already exists, return the url. If not create a new temporary schema file and return a the url.
[ "If", "url", "for", "schema", "already", "exists", "return", "the", "url", ".", "If", "not", "create", "a", "new", "temporary", "schema", "file", "and", "return", "a", "the", "url", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/avro/AvroSchemaManager.java#L185-L200
25,865
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java
TextSerializer.writeStringAsText
public static void writeStringAsText(DataOutput stream, String str) throws IOException { byte[] utf8Encoded = str.getBytes(StandardCharsets.UTF_8); writeVLong(stream, utf8Encoded.length); stream.write(utf8Encoded); }
java
public static void writeStringAsText(DataOutput stream, String str) throws IOException { byte[] utf8Encoded = str.getBytes(StandardCharsets.UTF_8); writeVLong(stream, utf8Encoded.length); stream.write(utf8Encoded); }
[ "public", "static", "void", "writeStringAsText", "(", "DataOutput", "stream", ",", "String", "str", ")", "throws", "IOException", "{", "byte", "[", "]", "utf8Encoded", "=", "str", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ";", "writeVLong", ...
Serialize a String using the same logic as a Hadoop Text object
[ "Serialize", "a", "String", "using", "the", "same", "logic", "as", "a", "Hadoop", "Text", "object" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java#L33-L37
25,866
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java
TextSerializer.readTextAsString
public static String readTextAsString(DataInput in) throws IOException { int bufLen = (int)readVLong(in); byte[] buf = new byte[bufLen]; in.readFully(buf); return new String(buf, StandardCharsets.UTF_8); }
java
public static String readTextAsString(DataInput in) throws IOException { int bufLen = (int)readVLong(in); byte[] buf = new byte[bufLen]; in.readFully(buf); return new String(buf, StandardCharsets.UTF_8); }
[ "public", "static", "String", "readTextAsString", "(", "DataInput", "in", ")", "throws", "IOException", "{", "int", "bufLen", "=", "(", "int", ")", "readVLong", "(", "in", ")", ";", "byte", "[", "]", "buf", "=", "new", "byte", "[", "bufLen", "]", ";", ...
Deserialize a Hadoop Text object into a String
[ "Deserialize", "a", "Hadoop", "Text", "object", "into", "a", "String" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java#L42-L48
25,867
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java
TextSerializer.writeVLong
private static void writeVLong(DataOutput stream, long i) throws IOException { if (i >= -112 && i <= 127) { stream.writeByte((byte)i); return; } int len = -112; if (i < 0) { i ^= -1L; // take one's complement' len = -120; } long tmp = i; while (tmp != 0) { tmp...
java
private static void writeVLong(DataOutput stream, long i) throws IOException { if (i >= -112 && i <= 127) { stream.writeByte((byte)i); return; } int len = -112; if (i < 0) { i ^= -1L; // take one's complement' len = -120; } long tmp = i; while (tmp != 0) { tmp...
[ "private", "static", "void", "writeVLong", "(", "DataOutput", "stream", ",", "long", "i", ")", "throws", "IOException", "{", "if", "(", "i", ">=", "-", "112", "&&", "i", "<=", "127", ")", "{", "stream", ".", "writeByte", "(", "(", "byte", ")", "i", ...
From org.apache.hadoop.io.WritableUtis Serializes a long to a binary stream with zero-compressed encoding. For -112 <= i <= 127, only one byte is used with the actual value. For other values of i, the first byte value indicates whether the long is positive or negative, and the number of bytes that follow. If the first...
[ "From", "org", ".", "apache", ".", "hadoop", ".", "io", ".", "WritableUtis" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java#L67-L94
25,868
apache/incubator-gobblin
gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java
TextSerializer.readVLong
private static long readVLong(DataInput stream) throws IOException { byte firstByte = stream.readByte(); int len = decodeVIntSize(firstByte); if (len == 1) { return firstByte; } long i = 0; for (int idx = 0; idx < len-1; idx++) { byte b = stream.readByte(); i = i << 8; i ...
java
private static long readVLong(DataInput stream) throws IOException { byte firstByte = stream.readByte(); int len = decodeVIntSize(firstByte); if (len == 1) { return firstByte; } long i = 0; for (int idx = 0; idx < len-1; idx++) { byte b = stream.readByte(); i = i << 8; i ...
[ "private", "static", "long", "readVLong", "(", "DataInput", "stream", ")", "throws", "IOException", "{", "byte", "firstByte", "=", "stream", ".", "readByte", "(", ")", ";", "int", "len", "=", "decodeVIntSize", "(", "firstByte", ")", ";", "if", "(", "len", ...
Reads a zero-compressed encoded long from input stream and returns it. @param stream Binary input stream @throws java.io.IOException @return deserialized long from stream.
[ "Reads", "a", "zero", "-", "compressed", "encoded", "long", "from", "input", "stream", "and", "returns", "it", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-api/src/main/java/org/apache/gobblin/compat/hadoop/TextSerializer.java#L102-L115
25,869
apache/incubator-gobblin
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/Orchestrator.java
Orchestrator.canRun
private boolean canRun(String flowName, String flowGroup, boolean allowConcurrentExecution) { if (allowConcurrentExecution) { return true; } else { return !flowStatusGenerator.isFlowRunning(flowName, flowGroup); } }
java
private boolean canRun(String flowName, String flowGroup, boolean allowConcurrentExecution) { if (allowConcurrentExecution) { return true; } else { return !flowStatusGenerator.isFlowRunning(flowName, flowGroup); } }
[ "private", "boolean", "canRun", "(", "String", "flowName", ",", "String", "flowGroup", ",", "boolean", "allowConcurrentExecution", ")", "{", "if", "(", "allowConcurrentExecution", ")", "{", "return", "true", ";", "}", "else", "{", "return", "!", "flowStatusGener...
Check if the flow instance is allowed to run. @param flowName @param flowGroup @param allowConcurrentExecution @return true if the {@link FlowSpec} allows concurrent executions or if no other instance of the flow is currently RUNNING.
[ "Check", "if", "the", "flow", "instance", "is", "allowed", "to", "run", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/Orchestrator.java#L315-L321
25,870
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaSource.java
KafkaSource.getAllPreviousOffsetState
private synchronized void getAllPreviousOffsetState(SourceState state) { if (this.doneGettingAllPreviousOffsets) { return; } this.previousOffsets.clear(); this.previousLowWatermarks.clear(); this.previousExpectedHighWatermarks.clear(); this.previousOffsetFetchEpochTimes.clear(); this.p...
java
private synchronized void getAllPreviousOffsetState(SourceState state) { if (this.doneGettingAllPreviousOffsets) { return; } this.previousOffsets.clear(); this.previousLowWatermarks.clear(); this.previousExpectedHighWatermarks.clear(); this.previousOffsetFetchEpochTimes.clear(); this.p...
[ "private", "synchronized", "void", "getAllPreviousOffsetState", "(", "SourceState", "state", ")", "{", "if", "(", "this", ".", "doneGettingAllPreviousOffsets", ")", "{", "return", ";", "}", "this", ".", "previousOffsets", ".", "clear", "(", ")", ";", "this", "...
this.previousOffsetFetchEpochTimes need to be initialized once
[ "this", ".", "previousOffsetFetchEpochTimes", "need", "to", "be", "initialized", "once" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaSource.java#L562-L618
25,871
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.getCoalesceColumnNames
public static String getCoalesceColumnNames(String columnOrColumnList) { if (Strings.isNullOrEmpty(columnOrColumnList)) { return null; } if (columnOrColumnList.contains(",")) { return "COALESCE(" + columnOrColumnList + ")"; } return columnOrColumnList; }
java
public static String getCoalesceColumnNames(String columnOrColumnList) { if (Strings.isNullOrEmpty(columnOrColumnList)) { return null; } if (columnOrColumnList.contains(",")) { return "COALESCE(" + columnOrColumnList + ")"; } return columnOrColumnList; }
[ "public", "static", "String", "getCoalesceColumnNames", "(", "String", "columnOrColumnList", ")", "{", "if", "(", "Strings", ".", "isNullOrEmpty", "(", "columnOrColumnList", ")", ")", "{", "return", "null", ";", "}", "if", "(", "columnOrColumnList", ".", "contai...
Get coalesce of columns if there are multiple comma-separated columns
[ "Get", "coalesce", "of", "columns", "if", "there", "are", "multiple", "comma", "-", "separated", "columns" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L62-L70
25,872
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.printTiming
public static String printTiming(long start, long end) { long totalMillis = end - start; long mins = TimeUnit.MILLISECONDS.toMinutes(totalMillis); long secs = TimeUnit.MILLISECONDS.toSeconds(totalMillis) - TimeUnit.MINUTES.toSeconds(mins); long millis = TimeUnit.MILLISECONDS.toMillis(totalMillis...
java
public static String printTiming(long start, long end) { long totalMillis = end - start; long mins = TimeUnit.MILLISECONDS.toMinutes(totalMillis); long secs = TimeUnit.MILLISECONDS.toSeconds(totalMillis) - TimeUnit.MINUTES.toSeconds(mins); long millis = TimeUnit.MILLISECONDS.toMillis(totalMillis...
[ "public", "static", "String", "printTiming", "(", "long", "start", ",", "long", "end", ")", "{", "long", "totalMillis", "=", "end", "-", "start", ";", "long", "mins", "=", "TimeUnit", ".", "MILLISECONDS", ".", "toMinutes", "(", "totalMillis", ")", ";", "...
Print time difference in minutes, seconds and milliseconds
[ "Print", "time", "difference", "in", "minutes", "seconds", "and", "milliseconds" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L205-L212
25,873
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.getColumnListFromQuery
public static List<String> getColumnListFromQuery(String query) { if (Strings.isNullOrEmpty(query)) { return null; } String queryLowerCase = query.toLowerCase(); int startIndex = queryLowerCase.indexOf("select ") + 7; int endIndex = queryLowerCase.indexOf(" from "); if (startIndex < 0 || e...
java
public static List<String> getColumnListFromQuery(String query) { if (Strings.isNullOrEmpty(query)) { return null; } String queryLowerCase = query.toLowerCase(); int startIndex = queryLowerCase.indexOf("select ") + 7; int endIndex = queryLowerCase.indexOf(" from "); if (startIndex < 0 || e...
[ "public", "static", "List", "<", "String", ">", "getColumnListFromQuery", "(", "String", "query", ")", "{", "if", "(", "Strings", ".", "isNullOrEmpty", "(", "query", ")", ")", "{", "return", "null", ";", "}", "String", "queryLowerCase", "=", "query", ".", ...
get column list from the user provided query to build schema with the respective columns @param input query @return list of columns
[ "get", "column", "list", "from", "the", "user", "provided", "query", "to", "build", "schema", "with", "the", "respective", "columns" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L219-L231
25,874
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.escapeSpecialCharacters
public static String escapeSpecialCharacters(String columnName, String escapeChars, String character) { if (Strings.isNullOrEmpty(columnName)) { return null; } if (StringUtils.isEmpty(escapeChars)) { return columnName; } List<String> specialChars = Arrays.asList(escapeChars.split(","))...
java
public static String escapeSpecialCharacters(String columnName, String escapeChars, String character) { if (Strings.isNullOrEmpty(columnName)) { return null; } if (StringUtils.isEmpty(escapeChars)) { return columnName; } List<String> specialChars = Arrays.asList(escapeChars.split(","))...
[ "public", "static", "String", "escapeSpecialCharacters", "(", "String", "columnName", ",", "String", "escapeChars", ",", "String", "character", ")", "{", "if", "(", "Strings", ".", "isNullOrEmpty", "(", "columnName", ")", ")", "{", "return", "null", ";", "}", ...
escape characters in column name or table name
[ "escape", "characters", "in", "column", "name", "or", "table", "name" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L261-L275
25,875
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.getLongWithCurrentDate
public static long getLongWithCurrentDate(String value, String timezone) { if (Strings.isNullOrEmpty(value)) { return 0; } DateTime time = getCurrentTime(timezone); DateTimeFormatter dtFormatter = DateTimeFormat.forPattern(CURRENT_DATE_FORMAT).withZone(time.getZone()); if (value.toUpperCase()...
java
public static long getLongWithCurrentDate(String value, String timezone) { if (Strings.isNullOrEmpty(value)) { return 0; } DateTime time = getCurrentTime(timezone); DateTimeFormatter dtFormatter = DateTimeFormat.forPattern(CURRENT_DATE_FORMAT).withZone(time.getZone()); if (value.toUpperCase()...
[ "public", "static", "long", "getLongWithCurrentDate", "(", "String", "value", ",", "String", "timezone", ")", "{", "if", "(", "Strings", ".", "isNullOrEmpty", "(", "value", ")", ")", "{", "return", "0", ";", "}", "DateTime", "time", "=", "getCurrentTime", ...
Helper method for getting a value containing CURRENTDAY-1 or CURRENTHOUR-1 in the form yyyyMMddHHmmss @param value @param timezone @return
[ "Helper", "method", "for", "getting", "a", "value", "containing", "CURRENTDAY", "-", "1", "or", "CURRENTHOUR", "-", "1", "in", "the", "form", "yyyyMMddHHmmss" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L283-L299
25,876
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.dateTimeToString
public static String dateTimeToString(DateTime input, String format, String timezone) { String tz = StringUtils.defaultString(timezone, ConfigurationKeys.DEFAULT_SOURCE_TIMEZONE); DateTimeZone dateTimeZone = getTimeZone(tz); DateTimeFormatter outputDtFormat = DateTimeFormat.forPattern(format).withZone(dateT...
java
public static String dateTimeToString(DateTime input, String format, String timezone) { String tz = StringUtils.defaultString(timezone, ConfigurationKeys.DEFAULT_SOURCE_TIMEZONE); DateTimeZone dateTimeZone = getTimeZone(tz); DateTimeFormatter outputDtFormat = DateTimeFormat.forPattern(format).withZone(dateT...
[ "public", "static", "String", "dateTimeToString", "(", "DateTime", "input", ",", "String", "format", ",", "String", "timezone", ")", "{", "String", "tz", "=", "StringUtils", ".", "defaultString", "(", "timezone", ",", "ConfigurationKeys", ".", "DEFAULT_SOURCE_TIME...
Convert joda time to a string in the given format @param input timestamp @param format expected format @param timezone time zone of timestamp @return string format of timestamp
[ "Convert", "joda", "time", "to", "a", "string", "in", "the", "given", "format" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L308-L313
25,877
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.getCurrentTime
public static DateTime getCurrentTime(String timezone) { String tz = StringUtils.defaultString(timezone, ConfigurationKeys.DEFAULT_SOURCE_TIMEZONE); DateTimeZone dateTimeZone = getTimeZone(tz); DateTime currentTime = new DateTime(dateTimeZone); return currentTime; }
java
public static DateTime getCurrentTime(String timezone) { String tz = StringUtils.defaultString(timezone, ConfigurationKeys.DEFAULT_SOURCE_TIMEZONE); DateTimeZone dateTimeZone = getTimeZone(tz); DateTime currentTime = new DateTime(dateTimeZone); return currentTime; }
[ "public", "static", "DateTime", "getCurrentTime", "(", "String", "timezone", ")", "{", "String", "tz", "=", "StringUtils", ".", "defaultString", "(", "timezone", ",", "ConfigurationKeys", ".", "DEFAULT_SOURCE_TIMEZONE", ")", ";", "DateTimeZone", "dateTimeZone", "=",...
Get current time - joda @param timezone time zone of current time @return current datetime in the given timezone
[ "Get", "current", "time", "-", "joda" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L320-L325
25,878
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.toDateTime
public static DateTime toDateTime(String input, String format, String timezone) { String tz = StringUtils.defaultString(timezone, ConfigurationKeys.DEFAULT_SOURCE_TIMEZONE); DateTimeZone dateTimeZone = getTimeZone(tz); DateTimeFormatter inputDtFormat = DateTimeFormat.forPattern(format).withZone(dateTimeZone...
java
public static DateTime toDateTime(String input, String format, String timezone) { String tz = StringUtils.defaultString(timezone, ConfigurationKeys.DEFAULT_SOURCE_TIMEZONE); DateTimeZone dateTimeZone = getTimeZone(tz); DateTimeFormatter inputDtFormat = DateTimeFormat.forPattern(format).withZone(dateTimeZone...
[ "public", "static", "DateTime", "toDateTime", "(", "String", "input", ",", "String", "format", ",", "String", "timezone", ")", "{", "String", "tz", "=", "StringUtils", ".", "defaultString", "(", "timezone", ",", "ConfigurationKeys", ".", "DEFAULT_SOURCE_TIMEZONE",...
Convert timestamp in a string format to joda time @param input timestamp @param format timestamp format @param timezone time zone of timestamp @return joda time
[ "Convert", "timestamp", "in", "a", "string", "format", "to", "joda", "time" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L334-L340
25,879
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.toDateTime
public static DateTime toDateTime(long input, String format, String timezone) { return toDateTime(Long.toString(input), format, timezone); }
java
public static DateTime toDateTime(long input, String format, String timezone) { return toDateTime(Long.toString(input), format, timezone); }
[ "public", "static", "DateTime", "toDateTime", "(", "long", "input", ",", "String", "format", ",", "String", "timezone", ")", "{", "return", "toDateTime", "(", "Long", ".", "toString", "(", "input", ")", ",", "format", ",", "timezone", ")", ";", "}" ]
Convert timestamp in a long format to joda time @param input timestamp @param format timestamp format @param timezone time zone of timestamp @return joda time
[ "Convert", "timestamp", "in", "a", "long", "format", "to", "joda", "time" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L349-L351
25,880
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java
Utils.getTimeZone
private static DateTimeZone getTimeZone(String id) { DateTimeZone zone; try { zone = DateTimeZone.forID(id); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("TimeZone " + id + " not recognized"); } return zone; }
java
private static DateTimeZone getTimeZone(String id) { DateTimeZone zone; try { zone = DateTimeZone.forID(id); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("TimeZone " + id + " not recognized"); } return zone; }
[ "private", "static", "DateTimeZone", "getTimeZone", "(", "String", "id", ")", "{", "DateTimeZone", "zone", ";", "try", "{", "zone", "=", "DateTimeZone", ".", "forID", "(", "id", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "throw...
Get time zone of time zone id @param id timezone id @return timezone
[ "Get", "time", "zone", "of", "time", "zone", "id" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/utils/Utils.java#L358-L366
25,881
apache/incubator-gobblin
gobblin-service/src/main/java/org/apache/gobblin/service/modules/scheduler/GobblinServiceJobScheduler.java
GobblinServiceJobScheduler.scheduleJob
@Override public synchronized void scheduleJob(Properties jobProps, JobListener jobListener) throws JobException { Map<String, Object> additionalJobDataMap = Maps.newHashMap(); additionalJobDataMap.put(ServiceConfigKeys.GOBBLIN_SERVICE_FLOWSPEC, this.scheduledFlowSpecs.get(jobProps.getProperty(Configu...
java
@Override public synchronized void scheduleJob(Properties jobProps, JobListener jobListener) throws JobException { Map<String, Object> additionalJobDataMap = Maps.newHashMap(); additionalJobDataMap.put(ServiceConfigKeys.GOBBLIN_SERVICE_FLOWSPEC, this.scheduledFlowSpecs.get(jobProps.getProperty(Configu...
[ "@", "Override", "public", "synchronized", "void", "scheduleJob", "(", "Properties", "jobProps", ",", "JobListener", "jobListener", ")", "throws", "JobException", "{", "Map", "<", "String", ",", "Object", ">", "additionalJobDataMap", "=", "Maps", ".", "newHashMap"...
Synchronize the job scheduling because the same flowSpec can be scheduled by different threads.
[ "Synchronize", "the", "job", "scheduling", "because", "the", "same", "flowSpec", "can", "be", "scheduled", "by", "different", "threads", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/scheduler/GobblinServiceJobScheduler.java#L191-L202
25,882
apache/incubator-gobblin
gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/ingestion/google/webmaster/UrlTriePrefixGrouper.java
UrlTriePrefixGrouper.groupToPages
public static ArrayList<String> groupToPages(Triple<String, GoogleWebmasterFilter.FilterOperator, UrlTrieNode> group) { ArrayList<String> ret = new ArrayList<>(); if (group.getMiddle().equals(GoogleWebmasterFilter.FilterOperator.EQUALS)) { if (group.getRight().isExist()) { ret.add(group.getLeft())...
java
public static ArrayList<String> groupToPages(Triple<String, GoogleWebmasterFilter.FilterOperator, UrlTrieNode> group) { ArrayList<String> ret = new ArrayList<>(); if (group.getMiddle().equals(GoogleWebmasterFilter.FilterOperator.EQUALS)) { if (group.getRight().isExist()) { ret.add(group.getLeft())...
[ "public", "static", "ArrayList", "<", "String", ">", "groupToPages", "(", "Triple", "<", "String", ",", "GoogleWebmasterFilter", ".", "FilterOperator", ",", "UrlTrieNode", ">", "group", ")", "{", "ArrayList", "<", "String", ">", "ret", "=", "new", "ArrayList",...
Get the detailed pages under this group
[ "Get", "the", "detailed", "pages", "under", "this", "group" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/google-ingestion/src/main/java/org/apache/gobblin/ingestion/google/webmaster/UrlTriePrefixGrouper.java#L78-L95
25,883
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
HadoopUtils.deletePathByRegex
public static void deletePathByRegex(FileSystem fs, final Path path, final String regex) throws IOException { FileStatus[] statusList = fs.listStatus(path, path1 -> path1.getName().matches(regex)); for (final FileStatus oldJobFile : statusList) { HadoopUtils.deletePath(fs, oldJobFile.getPath(), true); ...
java
public static void deletePathByRegex(FileSystem fs, final Path path, final String regex) throws IOException { FileStatus[] statusList = fs.listStatus(path, path1 -> path1.getName().matches(regex)); for (final FileStatus oldJobFile : statusList) { HadoopUtils.deletePath(fs, oldJobFile.getPath(), true); ...
[ "public", "static", "void", "deletePathByRegex", "(", "FileSystem", "fs", ",", "final", "Path", "path", ",", "final", "String", "regex", ")", "throws", "IOException", "{", "FileStatus", "[", "]", "statusList", "=", "fs", ".", "listStatus", "(", "path", ",", ...
Delete files according to the regular expression provided @param fs Filesystem object @param path base path @param regex regular expression to select files to delete @throws IOException
[ "Delete", "files", "according", "to", "the", "regular", "expression", "provided" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L197-L203
25,884
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
HadoopUtils.moveToTrash
public static void moveToTrash(FileSystem fs, Path path) throws IOException { Trash trash = new Trash(fs, new Configuration()); trash.moveToTrash(path); }
java
public static void moveToTrash(FileSystem fs, Path path) throws IOException { Trash trash = new Trash(fs, new Configuration()); trash.moveToTrash(path); }
[ "public", "static", "void", "moveToTrash", "(", "FileSystem", "fs", ",", "Path", "path", ")", "throws", "IOException", "{", "Trash", "trash", "=", "new", "Trash", "(", "fs", ",", "new", "Configuration", "(", ")", ")", ";", "trash", ".", "moveToTrash", "(...
Moves the object to the filesystem trash according to the file system policy. @param fs FileSystem object @param path Path to the object to be moved to trash. @throws IOException
[ "Moves", "the", "object", "to", "the", "filesystem", "trash", "according", "to", "the", "file", "system", "policy", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L211-L214
25,885
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
HadoopUtils.unsafeRenameIfNotExists
public static boolean unsafeRenameIfNotExists(FileSystem fs, Path from, Path to) throws IOException { if (!fs.exists(to)) { if (!fs.exists(to.getParent())) { fs.mkdirs(to.getParent()); } if (!renamePathHandleLocalFSRace(fs, from, to)) { if (!fs.exists(to)) { throw new IO...
java
public static boolean unsafeRenameIfNotExists(FileSystem fs, Path from, Path to) throws IOException { if (!fs.exists(to)) { if (!fs.exists(to.getParent())) { fs.mkdirs(to.getParent()); } if (!renamePathHandleLocalFSRace(fs, from, to)) { if (!fs.exists(to)) { throw new IO...
[ "public", "static", "boolean", "unsafeRenameIfNotExists", "(", "FileSystem", "fs", ",", "Path", "from", ",", "Path", "to", ")", "throws", "IOException", "{", "if", "(", "!", "fs", ".", "exists", "(", "to", ")", ")", "{", "if", "(", "!", "fs", ".", "e...
Renames from to to if to doesn't exist in a non-thread-safe way. @param fs filesystem where rename will be executed. @param from origin {@link Path}. @param to target {@link Path}. @return true if rename succeeded, false if the target already exists. @throws IOException if rename failed for reasons other than target e...
[ "Renames", "from", "to", "to", "if", "to", "doesn", "t", "exist", "in", "a", "non", "-", "thread", "-", "safe", "way", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L648-L664
25,886
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
HadoopUtils.setGroup
public static void setGroup(FileSystem fs, Path path, String group) throws IOException { fs.setOwner(path, fs.getFileStatus(path).getOwner(), group); }
java
public static void setGroup(FileSystem fs, Path path, String group) throws IOException { fs.setOwner(path, fs.getFileStatus(path).getOwner(), group); }
[ "public", "static", "void", "setGroup", "(", "FileSystem", "fs", ",", "Path", "path", ",", "String", "group", ")", "throws", "IOException", "{", "fs", ".", "setOwner", "(", "path", ",", "fs", ".", "getFileStatus", "(", "path", ")", ".", "getOwner", "(", ...
Set the group associated with a given path. @param fs the {@link FileSystem} instance used to perform the file operation @param path the given path @param group the group associated with the path @throws IOException
[ "Set", "the", "group", "associated", "with", "a", "given", "path", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L779-L781
25,887
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java
HadoopUtils.setPermissions
public static void setPermissions(Path location, Optional<String> owner, Optional<String> group, FileSystem fs, FsPermission permission) { try { if (!owner.isPresent()) { return; } if (!group.isPresent()) { return; } fs.setOwner(location, owner.get(), group.get())...
java
public static void setPermissions(Path location, Optional<String> owner, Optional<String> group, FileSystem fs, FsPermission permission) { try { if (!owner.isPresent()) { return; } if (!group.isPresent()) { return; } fs.setOwner(location, owner.get(), group.get())...
[ "public", "static", "void", "setPermissions", "(", "Path", "location", ",", "Optional", "<", "String", ">", "owner", ",", "Optional", "<", "String", ">", "group", ",", "FileSystem", "fs", ",", "FsPermission", "permission", ")", "{", "try", "{", "if", "(", ...
Try to set owner and permissions for the path. Will not throw exception.
[ "Try", "to", "set", "owner", "and", "permissions", "for", "the", "path", ".", "Will", "not", "throw", "exception", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/HadoopUtils.java#L937-L957
25,888
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/materializer/CopyTableQueryGenerator.java
CopyTableQueryGenerator.generateQueries
@Override public List<String> generateQueries() { ensureParentOfStagingPathExists(); List<String> hiveQueries = Lists.newArrayList(); /* * Setting partition mode to 'nonstrict' is needed to improve readability of the code. * If we do not set dynamic partition mode to nonstrict, we will have to...
java
@Override public List<String> generateQueries() { ensureParentOfStagingPathExists(); List<String> hiveQueries = Lists.newArrayList(); /* * Setting partition mode to 'nonstrict' is needed to improve readability of the code. * If we do not set dynamic partition mode to nonstrict, we will have to...
[ "@", "Override", "public", "List", "<", "String", ">", "generateQueries", "(", ")", "{", "ensureParentOfStagingPathExists", "(", ")", ";", "List", "<", "String", ">", "hiveQueries", "=", "Lists", ".", "newArrayList", "(", ")", ";", "/*\n * Setting partition ...
Returns hive queries to be run as a part of a hive task. This does not include publish queries. @return
[ "Returns", "hive", "queries", "to", "be", "run", "as", "a", "part", "of", "a", "hive", "task", ".", "This", "does", "not", "include", "publish", "queries", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/materializer/CopyTableQueryGenerator.java#L50-L97
25,889
apache/incubator-gobblin
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/workunit/packer/KafkaWorkUnitPacker.java
KafkaWorkUnitPacker.setWorkUnitEstSizes
public double setWorkUnitEstSizes(Map<String, List<WorkUnit>> workUnitsByTopic) { double totalEstDataSize = 0; for (List<WorkUnit> workUnitsForTopic : workUnitsByTopic.values()) { for (WorkUnit workUnit : workUnitsForTopic) { setWorkUnitEstSize(workUnit); totalEstDataSize += getWorkUnitEst...
java
public double setWorkUnitEstSizes(Map<String, List<WorkUnit>> workUnitsByTopic) { double totalEstDataSize = 0; for (List<WorkUnit> workUnitsForTopic : workUnitsByTopic.values()) { for (WorkUnit workUnit : workUnitsForTopic) { setWorkUnitEstSize(workUnit); totalEstDataSize += getWorkUnitEst...
[ "public", "double", "setWorkUnitEstSizes", "(", "Map", "<", "String", ",", "List", "<", "WorkUnit", ">", ">", "workUnitsByTopic", ")", "{", "double", "totalEstDataSize", "=", "0", ";", "for", "(", "List", "<", "WorkUnit", ">", "workUnitsForTopic", ":", "work...
Calculate the total size of the workUnits and set the estimated size for each workUnit @param workUnitsByTopic @return the total size of the input workUnits
[ "Calculate", "the", "total", "size", "of", "the", "workUnits", "and", "set", "the", "estimated", "size", "for", "each", "workUnit" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/workunit/packer/KafkaWorkUnitPacker.java#L370-L379
25,890
apache/incubator-gobblin
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-client/src/main/java/org/apache/gobblin/service/FlowStatusClient.java
FlowStatusClient.getFlowStatus
public FlowStatus getFlowStatus(FlowStatusId flowStatusId) throws RemoteInvocationException { LOG.debug("getFlowConfig with groupName " + flowStatusId.getFlowGroup() + " flowName " + flowStatusId.getFlowName()); GetRequest<FlowStatus> getRequest = _flowstatusesRequestBuilders.get() .id(ne...
java
public FlowStatus getFlowStatus(FlowStatusId flowStatusId) throws RemoteInvocationException { LOG.debug("getFlowConfig with groupName " + flowStatusId.getFlowGroup() + " flowName " + flowStatusId.getFlowName()); GetRequest<FlowStatus> getRequest = _flowstatusesRequestBuilders.get() .id(ne...
[ "public", "FlowStatus", "getFlowStatus", "(", "FlowStatusId", "flowStatusId", ")", "throws", "RemoteInvocationException", "{", "LOG", ".", "debug", "(", "\"getFlowConfig with groupName \"", "+", "flowStatusId", ".", "getFlowGroup", "(", ")", "+", "\" flowName \"", "+", ...
Get a flow status @param flowStatusId identifier of flow status to get @return a {@link FlowStatus} with the flow status @throws RemoteInvocationException
[ "Get", "a", "flow", "status" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-client/src/main/java/org/apache/gobblin/service/FlowStatusClient.java#L88-L99
25,891
apache/incubator-gobblin
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixJobLauncher.java
GobblinHelixJobLauncher.submitJobToHelix
private void submitJobToHelix(JobConfig.Builder jobConfigBuilder) throws Exception { HelixUtils.submitJobToWorkFlow(jobConfigBuilder, this.helixWorkFlowName, this.jobContext.getJobId(), this.helixTaskDriver, this.helixManager, this.workFlowExpiryTimeSeconds); }
java
private void submitJobToHelix(JobConfig.Builder jobConfigBuilder) throws Exception { HelixUtils.submitJobToWorkFlow(jobConfigBuilder, this.helixWorkFlowName, this.jobContext.getJobId(), this.helixTaskDriver, this.helixManager, this.workFlowExpiryTimeSeconds); }
[ "private", "void", "submitJobToHelix", "(", "JobConfig", ".", "Builder", "jobConfigBuilder", ")", "throws", "Exception", "{", "HelixUtils", ".", "submitJobToWorkFlow", "(", "jobConfigBuilder", ",", "this", ".", "helixWorkFlowName", ",", "this", ".", "jobContext", "....
Submit a job to run.
[ "Submit", "a", "job", "to", "run", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixJobLauncher.java#L343-L350
25,892
apache/incubator-gobblin
gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixJobLauncher.java
GobblinHelixJobLauncher.addAdditionalMetadataTags
private static List<? extends Tag<?>> addAdditionalMetadataTags(Properties jobProps, List<? extends Tag<?>> inputTags) { List<Tag<?>> metadataTags = Lists.newArrayList(inputTags); String jobId; // generate job id if not already set if (jobProps.containsKey(ConfigurationKeys.JOB_ID_KEY)) { jobId =...
java
private static List<? extends Tag<?>> addAdditionalMetadataTags(Properties jobProps, List<? extends Tag<?>> inputTags) { List<Tag<?>> metadataTags = Lists.newArrayList(inputTags); String jobId; // generate job id if not already set if (jobProps.containsKey(ConfigurationKeys.JOB_ID_KEY)) { jobId =...
[ "private", "static", "List", "<", "?", "extends", "Tag", "<", "?", ">", ">", "addAdditionalMetadataTags", "(", "Properties", "jobProps", ",", "List", "<", "?", "extends", "Tag", "<", "?", ">", ">", "inputTags", ")", "{", "List", "<", "Tag", "<", "?", ...
Inject in some additional properties @param jobProps job properties @param inputTags list of metadata tags @return
[ "Inject", "in", "some", "additional", "properties" ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-cluster/src/main/java/org/apache/gobblin/cluster/GobblinHelixJobLauncher.java#L470-L505
25,893
apache/incubator-gobblin
gobblin-utility/src/main/java/org/apache/gobblin/util/ClusterNameTags.java
ClusterNameTags.getClusterNameTags
public static Map<String, String> getClusterNameTags(Configuration conf) { ImmutableMap.Builder<String, String> tagMap = ImmutableMap.builder(); String clusterIdentifierTag = ClustersNames.getInstance().getClusterName(conf); if (!Strings.isNullOrEmpty(clusterIdentifierTag)) { tagMap.put(CLUSTER_IDENT...
java
public static Map<String, String> getClusterNameTags(Configuration conf) { ImmutableMap.Builder<String, String> tagMap = ImmutableMap.builder(); String clusterIdentifierTag = ClustersNames.getInstance().getClusterName(conf); if (!Strings.isNullOrEmpty(clusterIdentifierTag)) { tagMap.put(CLUSTER_IDENT...
[ "public", "static", "Map", "<", "String", ",", "String", ">", "getClusterNameTags", "(", "Configuration", "conf", ")", "{", "ImmutableMap", ".", "Builder", "<", "String", ",", "String", ">", "tagMap", "=", "ImmutableMap", ".", "builder", "(", ")", ";", "St...
Gets all useful Hadoop cluster metrics. @param conf a Hadoop {@link Configuration} to collect the metadata from @return a {@link Map} of key, value pairs containing the cluster metadata
[ "Gets", "all", "useful", "Hadoop", "cluster", "metrics", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ClusterNameTags.java#L53-L61
25,894
apache/incubator-gobblin
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java
FlowSpec.builder
public static FlowSpec.Builder builder(URI catalogURI, Properties flowProps) { String name = flowProps.getProperty(ConfigurationKeys.FLOW_NAME_KEY); String group = flowProps.getProperty(ConfigurationKeys.FLOW_GROUP_KEY, "default"); try { URI flowURI = new URI(catalogURI.getScheme(), catalogURI.getAut...
java
public static FlowSpec.Builder builder(URI catalogURI, Properties flowProps) { String name = flowProps.getProperty(ConfigurationKeys.FLOW_NAME_KEY); String group = flowProps.getProperty(ConfigurationKeys.FLOW_GROUP_KEY, "default"); try { URI flowURI = new URI(catalogURI.getScheme(), catalogURI.getAut...
[ "public", "static", "FlowSpec", ".", "Builder", "builder", "(", "URI", "catalogURI", ",", "Properties", "flowProps", ")", "{", "String", "name", "=", "flowProps", ".", "getProperty", "(", "ConfigurationKeys", ".", "FLOW_NAME_KEY", ")", ";", "String", "group", ...
Creates a builder for the FlowSpec based on values in a flow properties config.
[ "Creates", "a", "builder", "for", "the", "FlowSpec", "based", "on", "values", "in", "a", "flow", "properties", "config", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java#L90-L107
25,895
apache/incubator-gobblin
gobblin-compaction/src/main/java/org/apache/gobblin/compaction/dataset/TimeBasedSubDirDatasetsFinder.java
TimeBasedSubDirDatasetsFinder.folderWithinAllowedPeriod
protected boolean folderWithinAllowedPeriod(Path inputFolder, DateTime folderTime) { DateTime currentTime = new DateTime(this.timeZone); PeriodFormatter periodFormatter = getPeriodFormatter(); DateTime earliestAllowedFolderTime = getEarliestAllowedFolderTime(currentTime, periodFormatter); DateTime lates...
java
protected boolean folderWithinAllowedPeriod(Path inputFolder, DateTime folderTime) { DateTime currentTime = new DateTime(this.timeZone); PeriodFormatter periodFormatter = getPeriodFormatter(); DateTime earliestAllowedFolderTime = getEarliestAllowedFolderTime(currentTime, periodFormatter); DateTime lates...
[ "protected", "boolean", "folderWithinAllowedPeriod", "(", "Path", "inputFolder", ",", "DateTime", "folderTime", ")", "{", "DateTime", "currentTime", "=", "new", "DateTime", "(", "this", ".", "timeZone", ")", ";", "PeriodFormatter", "periodFormatter", "=", "getPeriod...
Return true iff input folder time is between compaction.timebased.min.time.ago and compaction.timebased.max.time.ago.
[ "Return", "true", "iff", "input", "folder", "time", "is", "between", "compaction", ".", "timebased", ".", "min", ".", "time", ".", "ago", "and", "compaction", ".", "timebased", ".", "max", ".", "time", ".", "ago", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/dataset/TimeBasedSubDirDatasetsFinder.java#L220-L237
25,896
apache/incubator-gobblin
gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/CompactionThresholdVerifier.java
CompactionThresholdVerifier.verify
public Result verify (FileSystemDataset dataset) { Map<String, Double> thresholdMap = RecompactionConditionBasedOnRatio. getDatasetRegexAndRecompactThreshold (state.getProp(MRCompactor.COMPACTION_LATEDATA_THRESHOLD_FOR_RECOMPACT_PER_DATASET, StringUtils.EMPTY)); CompactionPathP...
java
public Result verify (FileSystemDataset dataset) { Map<String, Double> thresholdMap = RecompactionConditionBasedOnRatio. getDatasetRegexAndRecompactThreshold (state.getProp(MRCompactor.COMPACTION_LATEDATA_THRESHOLD_FOR_RECOMPACT_PER_DATASET, StringUtils.EMPTY)); CompactionPathP...
[ "public", "Result", "verify", "(", "FileSystemDataset", "dataset", ")", "{", "Map", "<", "String", ",", "Double", ">", "thresholdMap", "=", "RecompactionConditionBasedOnRatio", ".", "getDatasetRegexAndRecompactThreshold", "(", "state", ".", "getProp", "(", "MRCompacto...
There are two record count we are comparing here 1) The new record count in the input folder 2) The record count we compacted previously from last run Calculate two numbers difference and compare with a predefined threshold. (Alternatively we can save the previous record count to a state store. However each input fold...
[ "There", "are", "two", "record", "count", "we", "are", "comparing", "here", "1", ")", "The", "new", "record", "count", "in", "the", "input", "folder", "2", ")", "The", "record", "count", "we", "compacted", "previously", "from", "last", "run", "Calculate", ...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-compaction/src/main/java/org/apache/gobblin/compaction/verify/CompactionThresholdVerifier.java#L64-L92
25,897
apache/incubator-gobblin
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/policy/RawDatasetRetentionPolicy.java
RawDatasetRetentionPolicy.listQualifiedRawFileSystemDatasetVersions
protected Collection<FileSystemDatasetVersion> listQualifiedRawFileSystemDatasetVersions(Collection<FileSystemDatasetVersion> allVersions) { return Lists.newArrayList(Collections2.filter(allVersions, new Predicate<FileSystemDatasetVersion>() { @Override public boolean apply(FileSystemDatasetVersion vers...
java
protected Collection<FileSystemDatasetVersion> listQualifiedRawFileSystemDatasetVersions(Collection<FileSystemDatasetVersion> allVersions) { return Lists.newArrayList(Collections2.filter(allVersions, new Predicate<FileSystemDatasetVersion>() { @Override public boolean apply(FileSystemDatasetVersion vers...
[ "protected", "Collection", "<", "FileSystemDatasetVersion", ">", "listQualifiedRawFileSystemDatasetVersions", "(", "Collection", "<", "FileSystemDatasetVersion", ">", "allVersions", ")", "{", "return", "Lists", ".", "newArrayList", "(", "Collections2", ".", "filter", "(",...
A raw dataset version is qualified to be deleted, iff the corresponding refined paths exist, and the latest mod time of all files is in the raw dataset is earlier than the latest mod time of all files in the refined paths.
[ "A", "raw", "dataset", "version", "is", "qualified", "to", "be", "deleted", "iff", "the", "corresponding", "refined", "paths", "exist", "and", "the", "latest", "mod", "time", "of", "all", "files", "is", "in", "the", "raw", "dataset", "is", "earlier", "than...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/retention/policy/RawDatasetRetentionPolicy.java#L73-L88
25,898
apache/incubator-gobblin
gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/converter/jdbc/AvroToJdbcEntryConverter.java
AvroToJdbcEntryConverter.convertSchema
@Override public JdbcEntrySchema convertSchema(Schema inputSchema, WorkUnitState workUnit) throws SchemaConversionException { LOG.info("Converting schema " + inputSchema); Preconditions.checkArgument(Type.RECORD.equals(inputSchema.getType()), "%s is expected for the first level element in Avro schema ...
java
@Override public JdbcEntrySchema convertSchema(Schema inputSchema, WorkUnitState workUnit) throws SchemaConversionException { LOG.info("Converting schema " + inputSchema); Preconditions.checkArgument(Type.RECORD.equals(inputSchema.getType()), "%s is expected for the first level element in Avro schema ...
[ "@", "Override", "public", "JdbcEntrySchema", "convertSchema", "(", "Schema", "inputSchema", ",", "WorkUnitState", "workUnit", ")", "throws", "SchemaConversionException", "{", "LOG", ".", "info", "(", "\"Converting schema \"", "+", "inputSchema", ")", ";", "Preconditi...
Converts Avro schema to JdbcEntrySchema. Few precondition to the Avro schema 1. Avro schema should have one entry type record at first depth. 2. Avro schema can recurse by having record inside record. 3. Supported Avro primitive types and conversion boolean --> java.lang.Boolean int --> java.lang.Integer long --> java...
[ "Converts", "Avro", "schema", "to", "JdbcEntrySchema", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/converter/jdbc/AvroToJdbcEntryConverter.java#L176-L205
25,899
apache/incubator-gobblin
gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/converter/jdbc/AvroToJdbcEntryConverter.java
AvroToJdbcEntryConverter.tryConvertAvroColNameToJdbcColName
private String tryConvertAvroColNameToJdbcColName(String avroColName) { if (!avroToJdbcColPairs.isPresent()) { String converted = avroColName.replaceAll(AVRO_NESTED_COLUMN_DELIMITER_REGEX_COMPATIBLE, JDBC_FLATTENED_COLUMN_DELIMITER); jdbcToAvroColPairs.put(converted, avroColName); return converted...
java
private String tryConvertAvroColNameToJdbcColName(String avroColName) { if (!avroToJdbcColPairs.isPresent()) { String converted = avroColName.replaceAll(AVRO_NESTED_COLUMN_DELIMITER_REGEX_COMPATIBLE, JDBC_FLATTENED_COLUMN_DELIMITER); jdbcToAvroColPairs.put(converted, avroColName); return converted...
[ "private", "String", "tryConvertAvroColNameToJdbcColName", "(", "String", "avroColName", ")", "{", "if", "(", "!", "avroToJdbcColPairs", ".", "isPresent", "(", ")", ")", "{", "String", "converted", "=", "avroColName", ".", "replaceAll", "(", "AVRO_NESTED_COLUMN_DELI...
Convert Avro column name to JDBC column name. If name mapping is defined, follow it. Otherwise, just return avro column name, while replacing nested column delimiter, dot, to underscore. This method also updates, mapping from JDBC column name to Avro column name for reverse look up. @param avroColName @return
[ "Convert", "Avro", "column", "name", "to", "JDBC", "column", "name", ".", "If", "name", "mapping", "is", "defined", "follow", "it", ".", "Otherwise", "just", "return", "avro", "column", "name", "while", "replacing", "nested", "column", "delimiter", "dot", "t...
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-sql/src/main/java/org/apache/gobblin/converter/jdbc/AvroToJdbcEntryConverter.java#L214-L225