name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
flink_Tuple23_equals_rdh
/** * Deep equality for tuples by calling equals() on the tuple members. * * @param o * the object checked for equality * @return true if this is equal to o. */ @Overridepublic boolean equals(Object o) { ...
3.26
flink_Tuple23_toString_rdh
// ------------------------------------------------------------------------------------------------- // standard utilities // ------------------------------------------------------------------------------------------------- /** * Creates a string representation of the tuple in the form (f0, f1, f2, f3, f4, f5, f6, f7,...
3.26
flink_Tuple23_of_rdh
/** * Creates a new tuple and assigns the given values to the tuple's fields. This is more * convenient than using the constructor, because the compiler can infer the generic type * arguments implicitly. For example: {@code Tuple3.of(n, x, s)} instead of {@code new * Tuple3<Integer, Double, String>(n, x, s)} */ pu...
3.26
flink_Tuple23_setFields_rdh
/** * Sets new values to all fields of the tuple. * * @param f0 * The value for field 0 * @param f1 * The value for field 1 * @param f2 * The value for field 2 * @param f3 * The value for field 3 * @param f4 * The value for field 4 * @param f5 * The value for field 5 * @param f6 * The valu...
3.26
flink_Tuple23_copy_rdh
/** * Shallow tuple copy. * * @return A new Tuple with the same fields as this. */ @Override @SuppressWarnings("unchecked") public Tuple23<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> copy() {return new Tuple23<>(this.f0, this.f1, this.f2, this.f3, this...
3.26
flink_SlideWithSizeAndSlide_on_rdh
/** * Specifies the time attribute on which rows are grouped. * * <p>For streaming tables you can specify grouping by a event-time or processing-time * attribute. * * <p>For batch tables you can specify grouping on a timestamp or long attribute. * * @param timeField * time attribute for streaming and batch t...
3.26
flink_RestServerEndpoint_createUploadDir_rdh
/** * Creates the upload dir if needed. */ static void createUploadDir(final Path uploadDir, final Logger log, final boolean initialCreation) throws IOException { if (!Files.exists(uploadDir)) { if (initialCreation) { log.info("Upload directory {} does not exist. ", uploadDir); } else { log.warn("Upload directory {} ...
3.26
flink_RestServerEndpoint_shutDownInternal_rdh
/** * Stops this REST server endpoint. * * @return Future which is completed once the shut down has been finished. */ protected CompletableFuture<Void> shutDownInternal() { synchronized(lock) { CompletableFuture<?> channelFuture = new CompletableFuture<>(); if (serverChannel != null) { serverChannel.close().add...
3.26
flink_RestServerEndpoint_start_rdh
/** * Starts this REST server endpoint. * * @throws Exception * if we cannot start the RestServerEndpoint */ public final void start() throws Exception { synchronized(lock) { Preconditions.checkState(state == State.CREATED, "The RestServerEndpoint cannot be restarted."); log.info("Starting r...
3.26
flink_RestServerEndpoint_getServerAddress_rdh
/** * Returns the address on which this endpoint is accepting requests. * * @return address on which this endpoint is accepting requests or null if none */ @Nullable public InetSocketAddress getServerAddress() { synchronized(lock) { assertRestServerHasBeenStarted(); Channel server = this...
3.26
flink_RestServerEndpoint_checkAndCreateUploadDir_rdh
/** * Checks whether the given directory exists and is writable. If it doesn't exist, this method * will attempt to create it. * * @param uploadDir * directory to check * @param log * logger used for logging output * @throws IOException * if the directory does not exist and cannot be created, or if the ...
3.26
flink_GroupReduceDriver_setup_rdh
// ------------------------------------------------------------------------ @Override public void setup(TaskContext<GroupReduceFunction<IT, OT>, OT> context) { this.taskContext = context; this.running = true; }
3.26
flink_ArrowSerializer_createArrowWriter_rdh
/** * Creates an {@link ArrowWriter}. */ public ArrowWriter<RowData> createArrowWriter() { return ArrowUtils.createRowDataArrowWriter(rootWriter, inputType); }
3.26
flink_ArrowSerializer_finishCurrentBatch_rdh
/** * Forces to finish the processing of the current batch of elements. It will serialize the batch * of elements into one arrow batch. */ public void finishCurrentBatch() throws Exception { arrowWriter.finish(); arrowStreamWriter.writeBatch(); arrowWriter.reset(); }
3.26
flink_IntervalJoinOperator_sideOutput_rdh
/** * Write skipped late arriving element to SideOutput. */ protected <T> void sideOutput(T value, long timestamp, boolean isLeft) { if (isLeft) { if (leftLateDataOutputTag != null) { output.collect(leftLateDataOutputTag, new StreamRecord<>(((T1) (value)), timestamp)); } ...
3.26
flink_IntervalJoinOperator_processElement1_rdh
/** * Process a {@link StreamRecord} from the left stream. Whenever an {@link StreamRecord} arrives * at the left stream, it will get added to the left buffer. Possible join candidates for that * element will be looked up from the right buffer and if the pair lies within the user defined * boundaries, it gets passe...
3.26
flink_DefaultFailureEnricherContext_forGlobalFailure_rdh
/** * Factory method returning a Global failure Context for the given params. */ public static Context forGlobalFailure(JobID jobID, String jobName, MetricGroup metricGroup, Executor ioExecutor, ClassLoader classLoader) { return new DefaultFailureEnricherContext(jobID, jobName, metricGroup, FailureType.GLOBAL, io...
3.26
flink_DefaultFailureEnricherContext_forTaskManagerFailure_rdh
/** * Factory method returning a TaskManager failure Context for the given params. */ public static Context forTaskManagerFailure(JobID jobID, String jobName, MetricGroup metricGroup, Executor ioExecutor, ClassLoader classLoader) { return new DefaultFailureEnricherContext(jobID, jobName, metricGroup, FailureType....
3.26
flink_VoidNamespaceSerializer_snapshotConfiguration_rdh
// ----------------------------------------------------------------------------------- @Override public TypeSerializerSnapshot<VoidNamespace> snapshotConfiguration() { return new VoidNamespaceSerializerSnapshot(); }
3.26
flink_AbstractInvokable_getEnvironment_rdh
// ------------------------------------------------------------------------ // Access to Environment and Configuration // ------------------------------------------------------------------------ /** * Returns the environment of this task. * * @return The environment of this task. */ public final Environment getEnvi...
3.26
flink_AbstractInvokable_triggerCheckpointAsync_rdh
// ------------------------------------------------------------------------ // Checkpointing Methods // ------------------------------------------------------------------------ @Overridepublic CompletableFuture<Boolean> triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions) {...
3.26
flink_AbstractInvokable_getIndexInSubtaskGroup_rdh
/** * Returns the index of this subtask in the subtask group. * * @return the index of this subtask in the subtask group */ public int getIndexInSubtaskGroup() { return this.environment.getTaskInfo().getIndexOfThisSubtask(); }
3.26
flink_AbstractInvokable_getJobConfiguration_rdh
/** * Returns the job configuration object which was attached to the original {@link org.apache.flink.runtime.jobgraph.JobGraph}. * * @return the job configuration object which was attached to the original {@link org.apache.flink.runtime.jobgraph.JobGraph} */ public Configuration getJobConfiguration() { return ...
3.26
flink_AbstractInvokable_getTaskConfiguration_rdh
/** * Returns the task configuration object which was attached to the original {@link org.apache.flink.runtime.jobgraph.JobVertex}. * * @return the task configuration object which was attached to the original {@link org.apache.flink.runtime.jobgraph.JobVertex} */public final Configuration getTaskConfiguration() { ...
3.26
flink_InputGateSpecUtils_getExclusiveBuffersPerChannel_rdh
/** * Since at least one floating buffer is required, the number of required buffers is reduced by * 1, and then the average number of buffers per channel is calculated. Returning the minimum * value to ensure that the number of required buffers per gate is not more than the given * requiredBuffersPerGate.}. */ pr...
3.26
flink_SqlGatewayEndpointFactoryUtils_createEndpointFactoryHelper_rdh
/** * Creates a utility that helps to validate options for a {@link SqlGatewayEndpointFactory}. * * <p>Note: This utility checks for left-over options in the final step. */ public static EndpointFactoryHelper createEndpointFactoryHelper(SqlGatewayEndpointFactory endpointFactory, SqlGatewayEndpointFactory.Context co...
3.26
flink_BlobUtils_createBlobStoreFromConfig_rdh
/** * Creates a BlobStore based on the parameters set in the configuration. * * @param config * configuration to use * @return a (distributed) blob store for high availability * @throws IOException * thrown if the (distributed) file storage cannot be created */ public static BlobStoreService createBlobStore...
3.26
flink_BlobUtils_moveTempFileToStore_rdh
/** * Moves the temporary <tt>incomingFile</tt> to its permanent location where it is available for * use (not thread-safe!). * * @param incomingFile * temporary file created during transfer * @param jobId * ID of the job this blob belongs to or <tt>null</tt> if job-unrelated * @param blobKey * BLOB key ...
3.26
flink_BlobUtils_getStorageLocationPath_rdh
/** * Returns the path for the given blob key. * * <p>The returned path can be used with the (local or HA) BLOB store file system back-end for * recovery purposes and follows the same scheme as {@link #getStorageLocation(File, JobID, * BlobKey)}. * * @param storageDir * storage directory used be the BLOB serv...
3.26
flink_BlobUtils_writeLength_rdh
/** * Auxiliary method to write the length of an upcoming data chunk to an output stream. * * @param length * the length of the upcoming data chunk in bytes * @param outputStream * the output stream to write the length to * @throws IOException * thrown if an I/O error occurs while writing to the output st...
3.26
flink_BlobUtils_readFully_rdh
/** * Auxiliary method to read a particular number of bytes from an input stream. This method * blocks until the requested number of bytes have been read from the stream. If the stream * cannot offer enough data, an {@link EOFException} is thrown. * * @param inputStream * The input stream to read the data from....
3.26
flink_BlobUtils_createBlobServer_rdh
/** * Creates the {@link BlobServer} from the given configuration, fallback storage directory and * blob store. * * @param configuration * for the BlobServer * @param fallbackStorageDirectory * fallback storage directory that is used if no other directory * has been explicitly configured * @param blobSto...
3.26
flink_BlobUtils_readExceptionFromStream_rdh
/** * Reads exception from given {@link InputStream}. * * @param in * the input stream to read from * @return exception that was read * @throws IOException * thrown if an I/O error occurs while reading from the input stream */ static Throwable readExceptionFromStream(InputStream in) throws IOException { ...
3.26
flink_BlobUtils_createBlobCacheService_rdh
/** * Creates the {@link BlobCacheService} from the given configuration, fallback storage * directory, blob view and blob server address. * * @param configuration * for the BlobCacheService * @param fallbackStorageDirectory * fallback storage directory * @param blobView * blob view * @param serverAddres...
3.26
flink_BlobUtils_createMessageDigest_rdh
/** * Creates a new instance of the message digest to use for the BLOB key computation. * * @return a new instance of the message digest to use for the BLOB key computation */ static MessageDigest createMessageDigest() { try { return MessageDigest.getInstance(HASHING_ALGORITHM);} catch (NoSuchAlgor...
3.26
flink_BlobUtils_readLength_rdh
/** * Auxiliary method to read the length of an upcoming data chunk from an input stream. * * @param inputStream * the input stream to read the length from * @return the length of the upcoming data chunk in bytes * @throws IOException * thrown i...
3.26
flink_BlobUtils_getIncomingDirectory_rdh
/** * Returns the BLOB service's directory for incoming (job-unrelated) files. The directory is * created if it does not exist yet. * * @param storageDir * storage directory used be the BLOB service * @return the BLOB service's directory for incoming files * @throws IOException * if creating the directory f...
3.26
flink_TimeWindowUtil_getShiftTimeZone_rdh
/** * Get the shifted timezone of window if the time attribute type is TIMESTAMP_LTZ, always * returns UTC timezone if the time attribute type is TIMESTAMP which means do not shift. */ public static ZoneId getShiftTimeZone(LogicalType timeAttributeType, ZoneId zoneFromConfig) { boolean needShiftTimeZone = timeAt...
3.26
flink_TimeWindowUtil_getNextTriggerWatermark_rdh
/** * Method to get the next watermark to trigger window. */ public static long getNextTriggerWatermark(long currentWatermark, long interval, ZoneId shiftTimezone, boolean useDayLightSaving) { if (currentWatermark == Long.MAX_VALUE) { return currentWatermark; } long triggerWatermark; // c...
3.26
flink_TimeWindowUtil_toUtcTimestampMills_rdh
/** * Convert a epoch mills to timestamp mills which can describe a locate date time. * * <p>For example: The timestamp string of epoch mills 5 in GMT+08:00 is 1970-01-01 08:00:05, * the timestamp mills is 8 * 60 * 60 * 1000 + 5. * * @param epochMills * the epoch mills. * @...
3.26
flink_TimeWindowUtil_toEpochMillsForTimer_rdh
/** * Get a timer time according to the timestamp mills and the given shift timezone. * * @param utcTimestampMills * the timestamp mills. * @param shiftTimeZone * the timezone that the given timestamp mills has been shifted. * @return the epoch mills. */ public static long toEpochMillsForTimer(long utcTimes...
3.26
flink_TimeWindowUtil_isWindowFired_rdh
/** * Returns the window should fired or not on current progress. * * @param windowEnd * the end of the time window. * @param currentProgress * current progress of the window operator, it is processing time under * proctime, it is watermark value under rowtime. * @param shiftTimeZone * the shifted time...
3.26
flink_TimeWindowUtil_toEpochMills_rdh
/** * Convert a timestamp mills with the given timezone to epoch mills. * * @param utcTimestampMills * the timezone that the given timestamp mills has been shifted. * @param shiftTimeZone * the timezone that the given timestamp mills has been shifted. * @return the epoch mills. */ public static long toEpoch...
3.26
flink_WatermarkStrategy_withWatermarkAlignment_rdh
/** * Creates a new {@link WatermarkStrategy} that configures the maximum watermark drift from * other sources/tasks/partitions in the same watermark group. The group may contain completely * independent sources (e.g. File and Kafka). * * <p>Once configured Flink will "pause" consuming from a source/task/partition...
3.26
flink_WatermarkStrategy_createTimestampAssigner_rdh
/** * Instantiates a {@link TimestampAssigner} for assigning timestamps according to this strategy. */ @Override default TimestampAssigner<T> createTimestampAssigner(TimestampAssignerSupplier.Context context) { // By default, this is {@link RecordTimestampAssigner}, // for cases where records come out...
3.26
flink_WatermarkStrategy_forGenerator_rdh
/** * Creates a watermark strategy based on an existing {@link WatermarkGeneratorSupplier}. */ static <T> WatermarkStrategy<T> forGenerator(WatermarkGeneratorSupplier<T> generatorSupplier) { return generatorSupplier::createWatermarkGenerator;}
3.26
flink_WatermarkStrategy_forBoundedOutOfOrderness_rdh
/** * Creates a watermark strategy for situations where records are out of order, but you can place * an upper bound on how far the events are out of order. An out-of-order bound B means that * once the an event with timestamp T was encountered, no events older than {@code T - B} will * follow any more. * * <p>Th...
3.26
flink_WatermarkStrategy_withTimestampAssigner_rdh
// ------------------------------------------------------------------------ // Builder methods for enriching a base WatermarkStrategy // ------------------------------------------------------------------------ /** * Creates a new {@code WatermarkStrategy} that wraps this strategy but instead uses the given * {@link T...
3.26
flink_WatermarkStrategy_forMonotonousTimestamps_rdh
// ------------------------------------------------------------------------ // Convenience methods for common watermark strategies // ------------------------------------------------------------------------ /** * Creates a watermark strategy for situations with monotonously ascending timestamps. * * <p>The watermark...
3.26
flink_WatermarkStrategy_withIdleness_rdh
/** * Creates a new enriched {@link WatermarkStrategy} that also does idleness detection in the * created {@link WatermarkGenerator}. * * <p>Add an idle timeout to the watermark strategy. If no records flow in a partition of a * stream for that amount of time, then t...
3.26
flink_WatermarkStrategy_noWatermarks_rdh
/** * Creates a watermark strategy that generates no watermarks at all. This may be useful in * scenarios that do pure processing-time based stream processing. */ static <T> WatermarkStrategy<T> noWatermarks() { return ctx -> new NoWatermarksGenerator<>(); }
3.26
flink_DataStructureConverters_putConverter_rdh
// -------------------------------------------------------------------------------------------- // Helper methods // -------------------------------------------------------------------------------------------- private static <E> void putConverter(LogicalTypeRoot root, Class<E> conversionClass, DataStructureConverterFac...
3.26
flink_DataStructureConverters_getConverter_rdh
/** * Returns a converter for the given {@link DataType}. */ @SuppressWarnings("unchecked") public static DataStructureConverter<Object, Object> getConverter(DataType dataType) { // cast to Object for ease of use return ((DataStructureConverter<Object, Object>) (getConverterInternal(dataType))); }
3.26
flink_ScriptProcessBuilder_getAbsolutePath_rdh
/** * Returns the full path name of this file if it is listed in the path. */ public File getAbsolutePath(String filename) { if (((pathenv == null) || (pathSep == null)) || (fileSep == null)) { return null; } int val; String classvalue = pathenv + pathSep; while (((val...
3.26
flink_ScriptProcessBuilder_addWrapper_rdh
/** * Wrap the script in a wrapper that allows admins to control. */ private String[] addWrapper(String[] inArgs) { String wrapper = HiveConf.getVar(jobConf, ConfVars.SCRIPTWRAPPER); if (wrapper == null) { return inArgs; } String[] v28 = splitArgs(wrapper); int totallength = v28.length +...
3.26
flink_ScriptProcessBuilder_addJobConfToEnvironment_rdh
/** * addJobConfToEnvironment is mostly shamelessly copied from hadoop streaming. Added additional * check on environment variable length */ void addJobConfToEnvironment(Configuration conf, Map<String, String> env) { for (Map.Entry<String, String> en : conf) { String v32 = en.getKey(); if (!black...
3.26
flink_ScriptProcessBuilder_prependPathComponent_rdh
/** * Appends the specified component to the path list. */ public void prependPathComponent(String str) { pathenv = (str + pathSep) + pathenv; }
3.26
flink_ScriptProcessBuilder_blackListed_rdh
/** * Checks whether a given configuration name is blacklisted and should not be converted to an * environment variable. */ private boolean blackListed(Configuration conf, String name) { if (blackListedConfEntries == null) { blackListedConfEntries = new HashSet<>(); if (conf != null) { ...
3.26
flink_ScriptProcessBuilder_splitArgs_rdh
// Code below shameless borrowed from Hadoop Streaming private String[] splitArgs(String args) { final int outSide = 1; final int singLeq = 2; final int doubleLeq = 3; List<String> argList = new ArrayList<>(); char[] ch = args.toCharArray(); int clen = ch.length; int state = outSid...
3.26
flink_ResourceID_generate_rdh
/** * Generate a random resource id. * * @return A random resource id. */ public static ResourceID generate() { return new ResourceID(new AbstractID().toString()); }
3.26
flink_ResourceID_getResourceIdString_rdh
/** * Gets the Resource Id as string. * * @return Stringified version of the ResourceID */ public final String getResourceIdString() { return f0; }
3.26
flink_FailureHandlingResult_getVerticesToRestart_rdh
/** * Returns the tasks to restart. * * @return the tasks to restart */ public Set<ExecutionVertexID> getVerticesToRestart() { if (canRestart()) { return verticesToRestart; } else { throw new IllegalStateException("Cannot get vertices to restart when the restarting is suppressed."); } }
3.26
flink_FailureHandlingResult_isGlobalFailure_rdh
/** * Checks if this failure was a global failure, i.e., coming from a "safety net" failover that * involved all tasks and should reset also components like the coordinators. */ public boolean isGlobalFailure() { return globalFailure; }
3.26
flink_FailureHandlingResult_getRestartDelayMS_rdh
/** * Returns the delay before the restarting. * * @return the delay before the restarting */ public long getRestartDelayMS() { if (canRestart()) { return restartDelayMS; } else { throw new IllegalStateException("Cannot get restart delay when the restarting is suppressed."); }} /** * ...
3.26
flink_FailureHandlingResult_unrecoverable_rdh
/** * Creates a result that the failure is not recoverable and no restarting should be conducted. * * <p>The result can be flagged to be from a global failure triggered by the scheduler, rather * than from the failure of an individual task. * * @param failedExecution * the {@link Execution} that the failure is...
3.26
flink_FailureHandlingResult_getError_rdh
/** * Returns reason why the restarting cannot be conducted. * * @return reason why the restarting cannot be conducted */ @Nullable public Throwable getError() { return error; }
3.26
flink_FailureHandlingResult_restartable_rdh
/** * Creates a result of a set of tasks to restart to recover from the failure. * * <p>The result can be flagged to be from a global failure triggered by the scheduler, rather * than from the failure of an individual task. * * @param failedExecution * the {@link Execution} that the failure is originating from...
3.26
flink_IteratorSourceEnumerator_start_rdh
// ------------------------------------------------------------------------ @Override public void start() {}
3.26
flink_ScalaProductFieldAccessorFactory_load_rdh
/** * Loads the implementation, if it is accessible. * * @param log * Logger to be used in case the loading fails * @return Loaded implementation, if it is accessible. */ static ScalaProductFieldAccessorFactory load(Logger log) {try { final Object factory = Class.forName("org.apache.flink.stream...
3.26
flink_MemoryTierSubpartitionProducerAgent_addFinishedBuffer_rdh
// ------------------------------------------------------------------------ // Internal Methods // ------------------------------------------------------------------------ private void addFinishedBuffer(NettyPayload nettyPayload) { finishedBufferIndex++; checkNotNull(nettyConnectionWriter).writeNettyPayload(net...
3.26
flink_MemoryTierSubpartitionProducerAgent_connectionEstablished_rdh
// ------------------------------------------------------------------------ // Called by MemoryTierProducerAgent // ------------------------------------------------------------------------ void connectionEstablished(NettyConnectionWriter nettyConnectionWriter) { this.nettyConnectionWriter = nettyConnectionWriter; }
3.26
flink_SqlReplaceTableAs_getFullConstraints_rdh
/** * Returns the column constraints plus the table constraints. */ public List<SqlTableConstraint> getFullConstraints() { return SqlConstraintValidator.getFullConstraints(tableConstraints, columnList);}
3.26
flink_CEP_pattern_rdh
/** * Creates a {@link PatternStream} from an input data stream and a pattern. * * @param input * DataStream containing the input events * @param pattern * Pattern specification which shall be detected * @param comparator * Comparator to sort events with equal timestamps * @param <T> * Type of the inp...
3.26
flink_FloatHashSet_add_rdh
/** * See {@link Float#equals(Object)}. */ public boolean add(final float k) { int intKey = Float.floatToIntBits(k); if (intKey == 0) {if (this.containsZero) { return false; } this.containsZero = true; } else { float[] key =...
3.26
flink_FloatHashSet_contains_rdh
/** * See {@link Float#equals(Object)}. */ public boolean contains(final float k) { int intKey = Float.floatToIntBits(k); if (intKey == 0) { return this.containsZero; } else { float[] key = this.key; int curr; int pos; if ((curr = Float.floatToIntBits(key[...
3.26
flink_ChangelogTruncateHelper_materialized_rdh
/** * Handle changelog materialization, potentially {@link #truncate() truncating} the changelog. * * @param upTo * exclusive */ public void materialized(SequenceNumber upTo) { materializedUpTo = upTo; truncate(); }
3.26
flink_ChangelogTruncateHelper_checkpoint_rdh
/** * Set the highest {@link SequenceNumber} of changelog used by the given checkpoint. * * @param lastUploadedTo * exclusive */ public void checkpoint(long checkpointId, SequenceNumber lastUploadedTo) { checkpointedUpTo.put(checkpointId, lastUploadedTo); }
3.26
flink_ChangelogTruncateHelper_checkpointSubsumed_rdh
/** * Handle checkpoint subsumption, potentially {@link #truncate() truncating} the changelog. */ public void checkpointSubsumed(long checkpointId) { SequenceNumber sqn = checkpointedUpTo.get(checkpointId); LOG.debug("checkpoint {} subsumed, max sqn: {}", checkpointId, sqn); if (sqn != null) { sub...
3.26
flink_CsvReader_fieldDelimiter_rdh
/** * Configures the delimiter that separates the fields within a row. The comma character ({@code ','}) is used by default. * * @param delimiter * The delimiter that separates the fields in one row. * @return The CSV reader instance itself, to allow for fluent function chaining. */ public CsvReader fieldDelimi...
3.26
flink_CsvReader_ignoreInvalidLines_rdh
/** * Sets the CSV reader to ignore any invalid lines. This is useful for files that contain an * empty line at the end, multiple header lines or comments. This would throw an exception * otherwise. * * @return The CSV reader instance itself, to allow for fluent function chaining. */ public CsvReader ignoreInvali...
3.26
flink_CsvReader_ignoreFirstLine_rdh
/** * Sets the CSV reader to ignore the first line. This is useful for files that contain a header * line. * * @return The CSV reader instance itself, to allow for fluent function chaining. */ public CsvReader ignoreFirstLine() { skipFirstLineAsHeader = true; return this; }
3.26
flink_CsvReader_ignoreComments_rdh
/** * Configures the string that starts comments. By default comments will be treated as invalid * lines. This function only recognizes comments which start at the beginning of the line! * * @param commentPrefix * The string that starts the comments. * @re...
3.26
flink_CsvReader_lineDelimiter_rdh
// -------------------------------------------------------------------------------------------- /** * Configures the delimiter that separates the lines/rows. The linebreak character ({@code '\n'}) is used by default. * * @param delimiter * The delimiter that separates the rows. * @return The CSV reader instance ...
3.26
flink_CsvReader_configureInputFormat_rdh
// -------------------------------------------------------------------------------------------- // Miscellaneous // -------------------------------------------------------------------------------------------- private void configureInputFormat(CsvInputFormat<?> format) { format.setCharset(this.f0); format.setDel...
3.26
flink_CsvReader_setCharset_rdh
/** * Sets the charset of the reader. * * @param charset * The character set to set. */ @PublicEvolving public void setCharset(String charset) { this.f0 = Preconditions.checkNotNull(charset); }
3.26
flink_CsvReader_m1_rdh
/** * Specifies the types for the CSV fields. This method parses the CSV data to a 18-tuple which * has fields of the specified types. This method is overloaded for each possible length of the * tuples to support type safe creation of data sets through CSV parsing. * * @param type0 * The type of CSV field 0 and...
3.26
flink_CsvReader_m0_rdh
/** * Specifies the types for the CSV fields. This method parses the CSV data to a 6-tuple which * has fields of the specified types. This method is overloaded for each possible length of the * tuples to support type safe creation of data sets through CSV parsing. * * @param type0 * The type of CSV field 0 and ...
3.26
flink_CsvReader_getCharset_rdh
/** * Gets the character set for the reader. Default is UTF-8. * * @return The charset for the reader. */ @PublicEvolving public String getCharset() { return this.f0; }
3.26
flink_CsvReader_types_rdh
/** * Specifies the types for the CSV fields. This method parses the CSV data to a 25-tuple which * has fields of the specified types. This method is overloaded for each possible length of the * tuples to support type safe creation of data sets through CSV parsing. * * @param type0 * The type of CSV field 0 and...
3.26
flink_CsvReader_tupleType_rdh
/** * Configures the reader to read the CSV data and parse it to the given type. The type must be a * subclass of {@link Tuple}. The type information for the fields is obtained from the type * class. The type consequently needs to specify all generic field types of the tuple. * * @param targetType * The class o...
3.26
flink_CsvReader_includeFields_rdh
/** * Configures which fields of the CSV file should be included and which should be skipped. The * bits in the value (read from least significant to most significant) define whether the field * at the corresponding position in the CSV schema should be included. parser will look at the * first {...
3.26
flink_CsvReader_pojoType_rdh
/** * Configures the reader to read the CSV data and parse it to the given type. The all fields of * the type must be public or able to set value. The type information for the fields is obtained * from the type class. * * @param pojoType * The class of the target POJO. * @param pojoFields * The fields of th...
3.26
flink_CsvReader_parseQuotedStrings_rdh
/** * Enables quoted String parsing. Field delimiters in quoted Strings are ignored. A String is * parsed as quoted if it starts and ends with a quoting character and as unquoted otherwise. * Leading or tailing whitespaces are not allowed. * * @param quoteCharacter * The character which is used as quoting chara...
3.26
flink_HiveParserContext_setTokenRewriteStream_rdh
/** * Set the token rewrite stream being used to parse the current top-level SQL statement. Note * that this should <b>not</b> be used for other parsing activities; for example, when we * encounter a reference to a view, we switch to a new stream for parsing the stored view * definition from the catalog, but we don...
3.26
flink_HiveParserContext_getDestNamePrefix_rdh
/** * The suffix is always relative to a given HiveParserASTNode. */ public DestClausePrefix getDestNamePrefix(HiveParserASTNode curNode) { assert curNode != null : "must supply curNode"; assert (curNode.getType() == HiveASTParser.TOK_INSERT_INTO) || (curNode.getType() == HiveASTParser.TOK_DESTINATION); r...
3.26
flink_TpchResultComparator_round_rdh
/** * Rounding function defined in TPC-H standard specification v2.18.0 chapter 10. */ private static double round(double x, int m) { if (x < 0) { throw new IllegalArgumentException("x must be non-negative"); } double y = x + (5 * Math.pow(10, (-m) - 1)); double z = y * Math.pow(10, m); do...
3.26
flink_BinaryRowData_anyNull_rdh
/** * The bit is 1 when the field is null. Default is 0. */ @Override public boolean anyNull() { // Skip the header. if ((segments[0].getLong(0) & FIRST_BYTE_ZERO) != 0) { return true;} for (int i = 8; i < f1; i += 8) { if (segments[0].getLong(i) != 0) { return true; }...
3.26
flink_BinaryRowData_isInFixedLengthPart_rdh
/** * If it is a fixed-length field, we can call this BinaryRowData's setXX method for in-place * updates. If it is variable-length field, can't use this method, because the underlying data * is stored continuously. */ public static boolean isInFixedLengthPart(LogicalType type) {switch (type.getTypeRoot()) { ...
3.26
flink_SharedBuffer_getEvent_rdh
/** * It always returns event either from state or cache. * * @param eventId * id of the event * @return event */ Lockable<V> getEvent(EventId eventId) { try { Lockable<V> lockableFromCache = eventsBufferCache.getIfPresent(eventId);if (Objects.nonNull(lockableFromCache)) { return lockab...
3.26
flink_SharedBuffer_flushCache_rdh
/** * Flush the event and node from cache to state. * * @throws Exception * Thrown if the system cannot access the state. */ void flushCache() throws Exception { if (!entryCache.asMap().isEmpty()) { entries.putAll(entryCache.asMap()); entryCache.invalidateAll(); } if (!eventsBufferCac...
3.26