idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
123,200 | public void addBroadcastSetForUpdateFunction ( String name , DataSet < ? > data ) { this . bcVarsUpdate . add ( new Tuple2 < String , DataSet < ? > > ( name , data ) ) ; } | Adds a data set as a broadcast set to the vertex update function . |
123,201 | public void setInput ( DataSet < Tuple2 < VertexKey , VertexValue > > inputData ) { TypeInformation < Tuple2 < VertexKey , VertexValue > > inputType = inputData . getType ( ) ; Validate . isTrue ( inputType . isTupleType ( ) && inputType . getArity ( ) == 2 , "The input data set (the initial vertices) must consist of 2... | Sets the input data set for this operator . In the case of this operator this input data set represents the set of vertices with their initial state . |
123,202 | public static final < VertexKey extends Comparable < VertexKey > , VertexValue , Message > VertexCentricIteration < VertexKey , VertexValue , Message , ? > withPlainEdges ( DataSet < Tuple2 < VertexKey , VertexKey > > edgesWithoutValue , VertexUpdateFunction < VertexKey , VertexValue , Message > vertexUpdateFunction , ... | Creates a new vertex - centric iteration operator for graphs where the edges are not associated with a value . |
123,203 | public void processIncomingAccumulators ( JobID jobID , Map < String , Accumulator < ? , ? > > newAccumulators ) { synchronized ( this . jobAccumulators ) { JobAccumulators jobAccumulators = this . jobAccumulators . get ( jobID ) ; if ( jobAccumulators == null ) { jobAccumulators = new JobAccumulators ( ) ; this . jobA... | Merges the new accumulators with the existing accumulators collected for the job . |
123,204 | public Map < String , Accumulator < ? , ? > > getJobAccumulators ( JobID jobID ) { JobAccumulators jobAccumulators = this . jobAccumulators . get ( jobID ) ; if ( jobAccumulators == null ) { return new HashMap < String , Accumulator < ? , ? > > ( ) ; } return jobAccumulators . getAccumulators ( ) ; } | Returns all collected accumulators for the job . For efficiency the internal accumulator is returned so please use it read - only . |
123,205 | private void cleanup ( JobID jobId ) { if ( ! lru . contains ( jobId ) ) { lru . addFirst ( jobId ) ; } if ( lru . size ( ) > this . maxEntries ) { JobID toRemove = lru . removeLast ( ) ; this . jobAccumulators . remove ( toRemove ) ; } } | Cleanup data for the oldest jobs if the maximum number of entries is reached . |
123,206 | public static void main ( String [ ] args ) { try { String configDir = null ; if ( args . length >= 2 && args [ 0 ] . equals ( "-configDir" ) ) { configDir = args [ 1 ] ; } if ( configDir == null ) { System . err . println ( "Error: Configuration directory must be specified.\nWebFrontend -configDir <directory>\n" ) ; S... | Main method . accepts a single parameter which is the config directory . |
123,207 | private long getLongInternal ( final String key , final long defaultValue ) { long retVal = defaultValue ; try { synchronized ( this . confData ) { if ( this . confData . containsKey ( key ) ) { retVal = Long . parseLong ( this . confData . get ( key ) ) ; } } } catch ( NumberFormatException e ) { if ( LOG . isDebugEna... | Returns the value associated with the given key as a long integer . |
123,208 | private Configuration getConfigurationInternal ( final String [ ] keys ) { Configuration conf = new Configuration ( ) ; synchronized ( this . confData ) { final Iterator < String > it = this . confData . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final String key = it . next ( ) ; boolean found = false ; ... | Internal non - static method to return configuration . |
123,209 | private void includeConfigurationInternal ( final Configuration conf ) { if ( conf == null ) { LOG . error ( "Given configuration object is null, ignoring it..." ) ; return ; } synchronized ( this . confData ) { final Iterator < String > it = conf . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final String ... | Internal non - static method to include configuration . |
123,210 | public void setRangePartitioned ( Ordering partitionOrdering , DataDistribution distribution ) { if ( partitionOrdering . getNumberOfFields ( ) != distribution . getNumberOfFields ( ) ) { throw new IllegalArgumentException ( "The number of keys in the distribution must match number of ordered fields." ) ; } this . part... | Sets the sink to partition the records into ranges over the given ordering . The bucket boundaries are determined using the given data distribution . |
123,211 | public void setMinimumNumberOfInstances ( final InstanceType instanceType , final int number ) { this . minimumMap . put ( instanceType , Integer . valueOf ( number ) ) ; } | Sets the minimum number of instances to be requested from the given instance type . |
123,212 | public void setMaximumNumberOfInstances ( final InstanceType instanceType , final int number ) { this . maximumMap . put ( instanceType , Integer . valueOf ( number ) ) ; } | Sets the maximum number of instances to be requested from the given instance type . |
123,213 | public void setNumberOfInstances ( final InstanceType instanceType , final int number ) { setMinimumNumberOfInstances ( instanceType , number ) ; setMaximumNumberOfInstances ( instanceType , number ) ; } | Sets both the minimum and the maximum number of instances to be requested from the given instance type . |
123,214 | public int getMinimumNumberOfInstances ( final InstanceType instanceType ) { final Integer val = this . minimumMap . get ( instanceType ) ; if ( val != null ) { return val . intValue ( ) ; } return 0 ; } | Returns the minimum number of instances to be requested from the given instance type . |
123,215 | public int getMaximumNumberOfInstances ( final InstanceType instanceType ) { final Integer val = this . maximumMap . get ( instanceType ) ; if ( val != null ) { return val . intValue ( ) ; } return 0 ; } | Returns the maximum number of instances to be requested from the given instance type . |
123,216 | public RequestedGlobalProperties filterByNodesConstantSet ( OptimizerNode node , int input ) { if ( this . ordering != null ) { for ( int col : this . ordering . getInvolvedIndexes ( ) ) { if ( ! node . isFieldConstant ( input , col ) ) { return null ; } } } else if ( this . partitioningFields != null ) { for ( int col... | Filters these properties by what can be preserved by the given node when propagated down to the given input . |
123,217 | public void parameterizeChannel ( Channel channel , boolean globalDopChange , boolean localDopChange ) { if ( isTrivial ( ) ) { channel . setShipStrategy ( globalDopChange ? ShipStrategyType . PARTITION_RANDOM : ShipStrategyType . FORWARD ) ; return ; } final GlobalProperties inGlobals = channel . getSource ( ) . getGl... | Parameterizes the ship strategy fields of a channel such that the channel produces the desired global properties . |
123,218 | static String convertScanToString ( Scan scan ) throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( out ) ; scan . write ( dos ) ; return Base64 . encodeBytes ( out . toByteArray ( ) ) ; } | Writes the given scan into a Base64 encoded string . |
123,219 | public static Scan convertStringToScan ( String base64 ) throws IOException { ByteArrayInputStream bis = new ByteArrayInputStream ( Base64 . decode ( base64 ) ) ; DataInputStream dis = new DataInputStream ( bis ) ; Scan scan = new Scan ( ) ; scan . readFields ( dis ) ; return scan ; } | Converts the given Base64 string back into a Scan instance . |
123,220 | private int incrementReferenceCounter ( final JobID jobID ) { while ( true ) { AtomicInteger ai = this . libraryReferenceCounter . get ( jobID ) ; if ( ai == null ) { ai = new AtomicInteger ( 1 ) ; if ( this . libraryReferenceCounter . putIfAbsent ( jobID , ai ) == null ) { return 1 ; } } else { return ai . incrementAn... | Increments the reference counter for the library manager entry with the given job ID . |
123,221 | private int decrementReferenceCounter ( final JobID jobID ) { final AtomicInteger ai = this . libraryReferenceCounter . get ( jobID ) ; if ( ai == null ) { throw new IllegalStateException ( "Cannot find reference counter entry for job " + jobID ) ; } int retVal = ai . decrementAndGet ( ) ; if ( retVal == 0 ) { this . l... | Decrements the reference counter for the library manager entry with the given job ID . |
123,222 | public static void register ( final JobID id , final String [ ] requiredJarFiles ) throws IOException { final LibraryCacheManager lib = get ( ) ; lib . registerInternal ( id , requiredJarFiles ) ; } | Registers a job ID with a set of library paths that are required to run the job . For every registered job the library cache manager creates a class loader that is used to instantiate the job s environment later on . |
123,223 | private void registerInternal ( final JobID id , final String [ ] requiredJarFiles ) throws IOException { while ( this . lockMap . putIfAbsent ( id , LOCK_OBJECT ) != null ) ; try { if ( incrementReferenceCounter ( id ) > 1 ) { return ; } if ( this . libraryManagerEntries . containsKey ( id ) ) { throw new IllegalState... | Registers a job ID with a set of library paths that are required to run the job . For every registered job the library cache manager creates a class loader that is used to instantiate the vertex s environment later on . |
123,224 | public void getEventsForJob ( final JobID jobID , final List < AbstractEvent > eventList , final boolean includeManagementEvents ) { synchronized ( this . collectedEvents ) { List < AbstractEvent > eventsForJob = this . collectedEvents . get ( jobID ) ; if ( eventsForJob != null ) { final Iterator < AbstractEvent > it ... | Retrieves and adds the collected events for the job with the given job ID to the provided list . |
123,225 | private void addEvent ( JobID jobID , AbstractEvent event ) { synchronized ( this . collectedEvents ) { List < AbstractEvent > eventList = this . collectedEvents . get ( jobID ) ; if ( eventList == null ) { eventList = new ArrayList < AbstractEvent > ( ) ; this . collectedEvents . put ( jobID , eventList ) ; } eventLis... | Adds an event to the job s event list . |
123,226 | public void registerJob ( final ExecutionGraph executionGraph , final boolean profilingAvailable , final long submissionTimestamp ) { final Iterator < ExecutionVertex > it = new ExecutionGraphIterator ( executionGraph , true ) ; while ( it . hasNext ( ) ) { final ExecutionVertex vertex = it . next ( ) ; vertex . regist... | Registers a job in form of its execution graph representation with the job progress collector . The collector will subscribe to state changes of the individual subtasks . A separate deregistration is not necessary since the job progress collector periodically discards outdated progress information . |
123,227 | public void run ( ) { final long currentTime = System . currentTimeMillis ( ) ; synchronized ( this . collectedEvents ) { final Iterator < JobID > it = this . collectedEvents . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final JobID jobID = it . next ( ) ; final List < AbstractEvent > eventList = this . co... | This method will periodically be called to clean up expired collected events . |
123,228 | private void updateManagementGraph ( final JobID jobID , final VertexAssignmentEvent vertexAssignmentEvent ) { synchronized ( this . recentManagementGraphs ) { final ManagementGraph managementGraph = this . recentManagementGraphs . get ( jobID ) ; if ( managementGraph == null ) { return ; } final ManagementVertex verte... | Applies changes in the vertex assignment to the stored management graph . |
123,229 | private void updateManagementGraph ( final JobID jobID , final ExecutionStateChangeEvent executionStateChangeEvent , String optionalMessage ) { synchronized ( this . recentManagementGraphs ) { final ManagementGraph managementGraph = this . recentManagementGraphs . get ( jobID ) ; if ( managementGraph == null ) { return... | Applies changes in the state of an execution vertex to the stored management graph . |
123,230 | public InputChannelResult readRecord ( T target ) throws IOException , InterruptedException { if ( this . channelToReadFrom == - 1 ) { if ( this . isClosed ( ) ) { return InputChannelResult . END_OF_STREAM ; } if ( Thread . interrupted ( ) ) { throw new InterruptedException ( ) ; } this . channelToReadFrom = waitForAny... | Reads a record from one of the associated input channels . Channels are read such that one buffer from a channel is consecutively consumed . The buffers in turn are consumed in the order in which they arrive . Note that this method is not guaranteed to return a record because the currently available channel data may no... |
123,231 | public void notifyRecordIsAvailable ( int channelIndex ) { this . availableChannels . add ( Integer . valueOf ( channelIndex ) ) ; RecordAvailabilityListener < T > listener = this . recordAvailabilityListener . get ( ) ; if ( listener != null ) { listener . reportRecordAvailability ( this ) ; } } | Notify the gate that the channel with the given index has at least one record available . |
123,232 | public void close ( ) throws IOException , InterruptedException { for ( int i = 0 ; i < this . getNumberOfInputChannels ( ) ; i ++ ) { final InputChannel < T > inputChannel = this . channels [ i ] ; inputChannel . close ( ) ; } } | Immediately closes the input gate and all its input channels . The corresponding output channels are notified . Any remaining records in any buffers or queue is considered irrelevant and is discarded . |
123,233 | private boolean hasWindowsDrive ( String path , boolean slashed ) { if ( ! OperatingSystem . isWindows ( ) ) { return false ; } final int start = slashed ? 1 : 0 ; return path . length ( ) >= start + 2 && ( slashed ? path . charAt ( 0 ) == '/' : true ) && path . charAt ( start + 1 ) == ':' && ( ( path . charAt ( start ... | Checks if the provided path string contains a windows drive letter . |
123,234 | protected SequentialStatistics createStatistics ( List < FileStatus > files , FileBaseStatistics stats ) throws IOException { if ( files . isEmpty ( ) ) { return null ; } BlockInfo blockInfo = this . createBlockInfo ( ) ; long totalCount = 0 ; for ( FileStatus file : files ) { if ( file . getLen ( ) < blockInfo . getIn... | Fill in the statistics . The last modification time and the total input size are prefilled . |
123,235 | void addGate ( final ManagementGate gate ) { if ( gate . isInputGate ( ) ) { this . inputGates . add ( gate ) ; } else { this . outputGates . add ( gate ) ; } } | Adds a management gate to this vertex . |
123,236 | public ManagementGate getInputGate ( final int index ) { if ( index < this . inputGates . size ( ) ) { return this . inputGates . get ( index ) ; } return null ; } | Returns the input gate at the given index . |
123,237 | public ManagementGate getOutputGate ( final int index ) { if ( index < this . outputGates . size ( ) ) { return this . outputGates . get ( index ) ; } return null ; } | Returns the output gate at the given index . |
123,238 | public String toJson ( ) { StringBuilder json = new StringBuilder ( "" ) ; json . append ( "{" ) ; json . append ( "\"vertexid\": \"" + this . getID ( ) + "\"," ) ; json . append ( "\"vertexname\": \"" + StringUtils . escapeHtml ( this . toString ( ) ) + "\"," ) ; json . append ( "\"vertexstatus\": \"" + this . getExec... | Returns Json representation of this ManagementVertex |
123,239 | public void eventOccurred ( AbstractTaskEvent event ) { if ( event instanceof TerminationEvent ) { terminationSignaled = true ; } else if ( event instanceof AllWorkersDoneEvent ) { AllWorkersDoneEvent wde = ( AllWorkersDoneEvent ) event ; aggregatorNames = wde . getAggregatorNames ( ) ; aggregates = wde . getAggregates... | barrier will release the waiting thread if an event occurs |
123,240 | private void writeJsonForJobs ( PrintWriter wrt , List < RecentJobEvent > jobs ) { try { wrt . write ( "[" ) ; for ( int i = 0 ; i < jobs . size ( ) ; i ++ ) { RecentJobEvent jobEvent = jobs . get ( i ) ; writeJsonForJob ( wrt , jobEvent ) ; if ( i != jobs . size ( ) - 1 ) { wrt . write ( "," ) ; } } wrt . write ( "]" ... | Writes ManagementGraph as Json for all recent jobs |
123,241 | private void writeJsonForArchive ( PrintWriter wrt , List < RecentJobEvent > jobs ) { wrt . write ( "[" ) ; Collections . sort ( jobs , new Comparator < RecentJobEvent > ( ) { public int compare ( RecentJobEvent o1 , RecentJobEvent o2 ) { if ( o1 . getTimestamp ( ) < o2 . getTimestamp ( ) ) { return 1 ; } else { return... | Writes Json with a list of currently archived jobs sorted by time |
123,242 | @ SuppressWarnings ( "static-access" ) public static void main ( String [ ] args ) throws IOException { Option configDirOpt = OptionBuilder . withArgName ( "config directory" ) . hasArg ( ) . withDescription ( "Specify configuration directory." ) . create ( "configDir" ) ; Option tempDir = OptionBuilder . withArgName (... | Entry point for the program . |
123,243 | private void runHeartbeatLoop ( ) { final long interval = GlobalConfiguration . getInteger ( ConfigConstants . TASK_MANAGER_HEARTBEAT_INTERVAL_KEY , ConfigConstants . DEFAULT_TASK_MANAGER_HEARTBEAT_INTERVAL ) ; while ( ! shutdownStarted . get ( ) ) { try { LOG . debug ( "heartbeat" ) ; this . jobManager . sendHeartbeat... | This method send the periodic heartbeats . |
123,244 | private InetAddress getTaskManagerAddress ( InetSocketAddress jobManagerAddress ) throws IOException { AddressDetectionState strategy = AddressDetectionState . ADDRESS ; while ( true ) { Enumeration < NetworkInterface > e = NetworkInterface . getNetworkInterfaces ( ) ; while ( e . hasMoreElements ( ) ) { NetworkInterfa... | Find out the TaskManager s own IP address . |
123,245 | private Task createAndRegisterTask ( final ExecutionVertexID id , final Configuration jobConfiguration , final RuntimeEnvironment environment ) throws InsufficientResourcesException , IOException { if ( id == null ) { throw new IllegalArgumentException ( "Argument id is null" ) ; } if ( environment == null ) { throw ne... | Registers an newly incoming runtime task with the task manager . |
123,246 | private void unregisterTask ( final ExecutionVertexID id ) { synchronized ( this ) { final Task task = this . runningTasks . remove ( id ) ; if ( task == null ) { LOG . error ( "Cannot find task with ID " + id + " to unregister" ) ; return ; } for ( Entry < String , String > e : DistributedCache . getCachedFile ( task ... | Unregisters a finished or aborted task . |
123,247 | public void shutdown ( ) { if ( ! this . shutdownStarted . compareAndSet ( false , true ) ) { return ; } LOG . info ( "Shutting down TaskManager" ) ; this . heartbeatThread . interrupt ( ) ; try { this . heartbeatThread . join ( 1000 ) ; } catch ( InterruptedException e ) { } RPC . stopProxy ( this . jobManager ) ; RPC... | Shuts the task manager down . |
123,248 | private static final void checkTempDirs ( final String [ ] tempDirs ) throws Exception { for ( int i = 0 ; i < tempDirs . length ; ++ i ) { final String dir = tempDirs [ i ] ; if ( dir == null ) { throw new Exception ( "Temporary file directory #" + ( i + 1 ) + " is null." ) ; } final File f = new File ( dir ) ; if ( !... | Checks whether the given strings describe existing directories that are writable . If that is not the case an exception is raised . |
123,249 | private static void logVersionInformation ( ) { String version = JobManager . class . getPackage ( ) . getImplementationVersion ( ) ; String revision = "<unknown>" ; try { Properties properties = new Properties ( ) ; InputStream propFile = JobManager . class . getClassLoader ( ) . getResourceAsStream ( ".version.proper... | Log Stratosphere version information . |
123,250 | public static void main ( String [ ] args ) { if ( System . getProperty ( "log4j.configuration" ) == null ) { Logger root = Logger . getRootLogger ( ) ; root . removeAllAppenders ( ) ; PatternLayout layout = new PatternLayout ( "%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n" ) ; ConsoleAppender appender = new ConsoleAppender (... | Entry point for the program |
123,251 | private TaskCancelResult cancelJob ( final ExecutionGraph eg ) { TaskCancelResult errorResult = null ; final Iterator < ExecutionVertex > it = new ExecutionGraphIterator ( eg , eg . getIndexOfCurrentExecutionStage ( ) , false , true ) ; while ( it . hasNext ( ) ) { final ExecutionVertex vertex = it . next ( ) ; final T... | Cancels all the tasks in the current and upper stages of the given execution graph . |
123,252 | public ManagementGraph getManagementGraph ( final JobID jobID ) throws IOException { ManagementGraph mg = this . eventCollector . getManagementGraph ( jobID ) ; if ( mg == null ) { if ( this . archive != null ) { mg = this . archive . getManagementGraph ( jobID ) ; } if ( mg == null ) { throw new IOException ( "Cannot ... | Returns current ManagementGraph from eventCollector and if not current from archive |
123,253 | public void startInfoServer ( ) { final Configuration config = GlobalConfiguration . getConfiguration ( ) ; try { int port = config . getInteger ( ConfigConstants . JOB_MANAGER_WEB_PORT_KEY , ConfigConstants . DEFAULT_JOB_MANAGER_WEB_FRONTEND_PORT ) ; server = new WebInfoServer ( config , port , this ) ; server . start... | Starts the Jetty Infoserver for the Jobmanager |
123,254 | public < T0 , T1 , T2 > DataSource < Tuple3 < T0 , T1 , T2 > > types ( Class < T0 > type0 , Class < T1 > type1 , Class < T2 > type2 ) { TupleTypeInfo < Tuple3 < T0 , T1 , T2 > > types = TupleTypeInfo . getBasicTupleTypeInfo ( type0 , type1 , type2 ) ; CsvInputFormat < Tuple3 < T0 , T1 , T2 > > inputFormat = new CsvInpu... | Specifies the types for the CSV fields . This method parses the CSV data to a 3 - 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 . |
123,255 | public Ordering appendOrdering ( Integer index , Class < ? extends Key < ? > > type , Order order ) { if ( index . intValue ( ) < 0 ) { throw new IllegalArgumentException ( "The key index must not be negative." ) ; } if ( order == null ) { throw new NullPointerException ( ) ; } if ( order == Order . NONE ) { throw new ... | Extends this ordering by appending an additional order requirement . |
123,256 | public void setHashPartitioned ( FieldList partitionedFields ) { this . partitioning = PartitioningProperty . HASH_PARTITIONED ; this . partitioningFields = partitionedFields ; this . ordering = null ; } | Sets the partitioning property for the global properties . |
123,257 | public GlobalProperties filterByNodesConstantSet ( OptimizerNode node , int input ) { if ( this . ordering != null ) { for ( int col : this . ordering . getInvolvedIndexes ( ) ) { if ( ! node . isFieldConstant ( input , col ) ) { return new GlobalProperties ( ) ; } } } if ( this . partitioningFields != null ) { for ( i... | Filters these properties by what can be preserved through the given output contract . |
123,258 | public DeltaIteration < ST , WT > parallelism ( int parallelism ) { Validate . isTrue ( parallelism > 0 || parallelism == - 1 , "The degree of parallelism must be positive, or -1 (use default)." ) ; this . parallelism = parallelism ; return this ; } | Sets the degree of parallelism for the iteration . |
123,259 | private void showErrorPage ( HttpServletResponse resp , String message ) throws IOException { resp . setStatus ( HttpServletResponse . SC_OK ) ; resp . setContentType ( GUIServletStub . CONTENT_TYPE_HTML ) ; PrintWriter writer = resp . getWriter ( ) ; writer . println ( "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Tr... | Prints the error page containing the given message . |
123,260 | private boolean checkParameterSet ( HttpServletResponse resp , String parameter , String parameterName ) throws IOException { if ( parameter == null ) { showErrorPage ( resp , "The parameter '" + parameterName + "' is not set." ) ; return true ; } else { return false ; } } | Checks the given parameter . If it is null it prints the error page . |
123,261 | private void cancelOrKillExecution ( boolean cancel ) { final Thread executingThread = this . environment . getExecutingThread ( ) ; if ( executingThread == null ) { return ; } if ( this . executionState != ExecutionState . RUNNING && this . executionState != ExecutionState . FINISHING ) { return ; } LOG . info ( ( can... | Cancels or kills the task . |
123,262 | public boolean hasNext ( ) throws IOException , InterruptedException { if ( this . lookahead != null ) { return true ; } else { if ( this . noMoreRecordsWillFollow ) { return false ; } T record = instantiateRecordType ( ) ; while ( true ) { InputChannelResult result = this . inputGate . readRecord ( record ) ; switch (... | Checks if at least one more record can be read from the associated input gate . This method may block until the associated input gate is able to read the record from one of its input channels . |
123,263 | private final void checkAndCreateDirectories ( File f , boolean needWritePermission ) throws IOException { String dir = f . getAbsolutePath ( ) ; if ( f . exists ( ) && ! f . isDirectory ( ) ) { throw new IOException ( "A none directory file with the same name as the configured directory '" + dir + "' already exists." ... | Checks and creates the directory described by the abstract directory path . This function checks if the directory exists and creates it if necessary . It also checks read permissions and write permission if necessary . |
123,264 | public O withConstantSet ( String ... constantSet ) { SingleInputSemanticProperties props = SemanticPropUtil . getSemanticPropsSingleFromString ( constantSet , null , null , this . getInputType ( ) , this . getResultType ( ) ) ; this . setSemanticProperties ( props ) ; @ SuppressWarnings ( "unchecked" ) O returnType = ... | Adds a constant - set annotation for the UDF . |
123,265 | private void fillReadBuffer ( ) throws IOException { if ( splitLength == FileInputFormat . READ_WHOLE_SPLIT_FLAG ) { int read = this . stream . read ( this . readBuffer , 0 , this . readBufferSize ) ; if ( read == - 1 ) { exhausted = true ; } else { this . streamPos += read ; this . readBufferPos = 0 ; this . readBuffe... | Fills the next read buffer from the file stream . |
123,266 | public static Set < Annotation > readSingleConstantAnnotations ( Class < ? > udfClass ) { ConstantFields constantSet = udfClass . getAnnotation ( ConstantFields . class ) ; ConstantFieldsExcept notConstantSet = udfClass . getAnnotation ( ConstantFieldsExcept . class ) ; ReadFields readfieldSet = udfClass . getAnnotatio... | Reads the annotations of a user defined function with one input and returns semantic properties according to the constant fields annotated . |
123,267 | public static Set < Annotation > readDualConstantAnnotations ( Class < ? > udfClass ) { ConstantFieldsFirst constantSet1 = udfClass . getAnnotation ( ConstantFieldsFirst . class ) ; ConstantFieldsSecond constantSet2 = udfClass . getAnnotation ( ConstantFieldsSecond . class ) ; ConstantFieldsFirstExcept notConstantSet1 ... | Reads the annotations of a user defined function with two inputs and returns semantic properties according to the constant fields annotated . |
123,268 | public final CheckedMemorySegment put ( int index , byte b ) { if ( index >= 0 && index < this . size ) { this . memory [ this . offset + index ] = b ; return this ; } else { throw new IndexOutOfBoundsException ( ) ; } } | Writes the given byte into this buffer at the given position . |
123,269 | public final CheckedMemorySegment get ( int index , byte [ ] dst , int offset , int length ) { if ( index >= 0 && index < this . size && index <= this . size - length && offset <= dst . length - length ) { System . arraycopy ( this . memory , this . offset + index , dst , offset , length ) ; return this ; } else { thro... | Bulk get method . Copies length memory from the specified position to the destination memory beginning at the given offset |
123,270 | public final CheckedMemorySegment put ( int index , byte [ ] src , int offset , int length ) { if ( index >= 0 && index < this . size && index <= this . size - length && offset <= src . length - length ) { System . arraycopy ( src , offset , this . memory , this . offset + index , length ) ; return this ; } else { thro... | Bulk put method . Copies length memory starting at position offset from the source memory into the memory segment starting at the specified index . |
123,271 | public final CheckedMemorySegment putBoolean ( int index , boolean value ) { if ( index >= 0 && index < this . size ) { this . memory [ this . offset + index ] = ( byte ) ( value ? 1 : 0 ) ; return this ; } else { throw new IndexOutOfBoundsException ( ) ; } } | Writes one byte containing the byte value into this buffer at the given position . |
123,272 | public final char getChar ( int index ) { if ( index >= 0 && index < this . size - 1 ) { return ( char ) ( ( ( this . memory [ this . offset + index + 0 ] & 0xff ) << 8 ) | ( this . memory [ this . offset + index + 1 ] & 0xff ) ) ; } else { throw new IndexOutOfBoundsException ( ) ; } } | Reads two memory at the given position composing them into a char value according to the current byte order . |
123,273 | public final CheckedMemorySegment putChar ( int index , char value ) { if ( index >= 0 && index < this . size - 1 ) { this . memory [ this . offset + index + 0 ] = ( byte ) ( value >> 8 ) ; this . memory [ this . offset + index + 1 ] = ( byte ) value ; return this ; } else { throw new IndexOutOfBoundsException ( ) ; } ... | Writes two memory containing the given char value in the current byte order into this buffer at the given position . |
123,274 | public final short getShort ( int index ) { if ( index >= 0 && index < this . size - 1 ) { return ( short ) ( ( ( this . memory [ this . offset + index + 0 ] & 0xff ) << 8 ) | ( ( this . memory [ this . offset + index + 1 ] & 0xff ) ) ) ; } else { throw new IndexOutOfBoundsException ( ) ; } } | Reads two memory at the given position composing them into a short value according to the current byte order . |
123,275 | public final CheckedMemorySegment putShort ( int index , short value ) { if ( index >= 0 && index < this . size - 1 ) { this . memory [ this . offset + index + 0 ] = ( byte ) ( value >> 8 ) ; this . memory [ this . offset + index + 1 ] = ( byte ) value ; return this ; } else { throw new IndexOutOfBoundsException ( ) ; ... | Writes two memory containing the given short value in the current byte order into this buffer at the given position . |
123,276 | private void sortAvailableInstancesByNumberOfCPUCores ( ) { if ( this . availableInstanceTypes . length < 2 ) { return ; } for ( int i = 1 ; i < this . availableInstanceTypes . length ; i ++ ) { final InstanceType it = this . availableInstanceTypes [ i ] ; int j = i ; while ( j > 0 && this . availableInstanceTypes [ j ... | Sorts the list of available instance types by the number of CPU cores in a descending order . |
123,277 | private void checkPendingRequests ( ) { final Iterator < Map . Entry < JobID , PendingRequestsMap > > it = this . pendingRequestsOfJob . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final List < AllocatedResource > allocatedResources = new ArrayList < AllocatedResource > ( ) ; final Map . Entry < JobID , ... | Checks if a pending request can be fulfilled . |
123,278 | private AllocatedSlice getSliceOfType ( final JobID jobID , final InstanceType instanceType ) { AllocatedSlice slice = null ; for ( final ClusterInstance host : this . registeredHosts . values ( ) ) { if ( host . getType ( ) . equals ( instanceType ) ) { slice = host . createSlice ( instanceType , jobID ) ; if ( slice ... | Attempts to allocate a slice of the given type for the given job . The method first attempts to allocate this slice by finding a physical host which exactly matches the given instance type . If this attempt failed it tries to allocate the slice by partitioning the resources of a more powerful host . |
123,279 | private int [ ] [ ] calculateInstanceAccommodationMatrix ( ) { if ( this . availableInstanceTypes == null ) { LOG . error ( "Cannot compute instance accommodation matrix: availableInstanceTypes is null" ) ; return null ; } final int matrixSize = this . availableInstanceTypes . length ; final int [ ] [ ] am = new int [ ... | Calculates the instance accommodation matrix which stores how many times a particular instance type can be accommodated inside another instance type based on the list of available instance types . |
123,280 | public void stop ( ) throws Exception { synchronized ( this . lock ) { if ( this . nephele != null ) { this . nephele . stop ( ) ; this . nephele = null ; } else { throw new IllegalStateException ( "The local executor was not started." ) ; } } } | Stop the local executor instance . You should not call executePlan after this . |
123,281 | public JobExecutionResult executePlan ( Plan plan ) throws Exception { if ( plan == null ) { throw new IllegalArgumentException ( "The plan may not be null." ) ; } ContextChecker checker = new ContextChecker ( ) ; checker . check ( plan ) ; synchronized ( this . lock ) { final boolean shutDownAtEnd ; if ( this . nephel... | Execute the given plan on the local Nephele instance wait for the job to finish and return the runtime in milliseconds . |
123,282 | public static JobExecutionResult execute ( Plan plan ) throws Exception { LocalExecutor exec = new LocalExecutor ( ) ; try { exec . start ( ) ; return exec . executePlan ( plan ) ; } finally { exec . stop ( ) ; } } | Executes the program represented by the given Pact plan . |
123,283 | public static String getPlanAsJSON ( Plan plan ) { PlanJSONDumpGenerator gen = new PlanJSONDumpGenerator ( ) ; List < DataSinkNode > sinks = PactCompiler . createPreOptimizedPlan ( plan ) ; return gen . getPactPlanAsJSON ( sinks ) ; } | Return unoptimized plan as JSON . |
123,284 | public void register ( Task task ) throws InsufficientResourcesException { ensureBufferAvailability ( task ) ; RuntimeEnvironment environment = task . getRuntimeEnvironment ( ) ; environment . registerGlobalBufferPool ( this . globalBufferPool ) ; if ( this . localBuffersPools . containsKey ( task . getVertexID ( ) ) )... | Registers the given task with the channel manager . |
123,285 | public void unregister ( ExecutionVertexID vertexId , Task task ) { final Environment environment = task . getEnvironment ( ) ; for ( ChannelID id : environment . getOutputChannelIDs ( ) ) { Channel channel = this . channels . remove ( id ) ; if ( channel != null ) { channel . destroy ( ) ; } this . receiverCache . rem... | Unregisters the given task from the channel manager . |
123,286 | private EnvelopeReceiverList getReceiverList ( JobID jobID , ChannelID sourceChannelID , boolean reportException ) throws IOException { EnvelopeReceiverList receiverList = this . receiverCache . get ( sourceChannelID ) ; if ( receiverList != null ) { return receiverList ; } while ( true ) { ConnectionInfoLookupResponse... | Returns the list of receivers for transfer envelopes produced by the channel with the given source channel ID . |
123,287 | public void invalidateLookupCacheEntries ( Set < ChannelID > channelIDs ) { for ( ChannelID id : channelIDs ) { this . receiverCache . remove ( id ) ; } } | Invalidates the entries identified by the given channel IDs from the receiver lookup cache . |
123,288 | public static Class < ? extends VersionedProtocol > getProtocolByName ( final String className ) throws ClassNotFoundException { if ( ! className . contains ( "Protocol" ) ) { throw new ClassNotFoundException ( "Only use this method for protocols!" ) ; } return ( Class < ? extends VersionedProtocol > ) Class . forName ... | Searches for a protocol class by its name and attempts to load it . |
123,289 | @ SuppressWarnings ( "unchecked" ) public static Class < ? extends IOReadableWritable > getRecordByName ( final String className ) throws ClassNotFoundException { return ( Class < ? extends IOReadableWritable > ) Class . forName ( className , true , getClassLoader ( ) ) ; } | Searches for a record class by its name and attempts to load it . |
123,290 | public static Class < ? extends FileSystem > getFileSystemByName ( final String className ) throws ClassNotFoundException { return Class . forName ( className , true , getClassLoader ( ) ) . asSubclass ( FileSystem . class ) ; } | Searches for a file system class by its name and attempts to load it . |
123,291 | public void open ( ) { if ( ! this . closed . compareAndSet ( true , false ) ) { throw new IllegalStateException ( "Hash Table cannot be opened, because it is currently not closed." ) ; } final int partitionFanOut = getPartitioningFanOutNoEstimates ( this . availableMemory . size ( ) ) ; createPartitions ( partitionFan... | Build the hash table |
123,292 | protected void mergeBranchPlanMaps ( Map < OptimizerNode , PlanNode > branchPlan1 , Map < OptimizerNode , PlanNode > branchPlan2 ) { } | Merging can only take place after the solutionSetDelta and nextWorkset PlanNode has been set because they can contain also some of the branching nodes . |
123,293 | public FileInputSplit [ ] createInputSplits ( int minNumSplits ) throws IOException { int numAvroFiles = 0 ; final Path path = this . filePath ; final FileSystem fs = path . getFileSystem ( ) ; final FileStatus pathFile = fs . getFileStatus ( path ) ; if ( ! acceptFile ( pathFile ) ) { throw new IOException ( "The give... | Set minNumSplits to number of files . |
123,294 | public int getNumberOfInputExecutionVertices ( ) { int retVal = 0 ; final Iterator < ExecutionGroupVertex > it = this . stageMembers . iterator ( ) ; while ( it . hasNext ( ) ) { final ExecutionGroupVertex groupVertex = it . next ( ) ; if ( groupVertex . isInputVertex ( ) ) { retVal += groupVertex . getCurrentNumberOfG... | Returns the number of input execution vertices in this stage i . e . the number of execution vertices which are connected to vertices in a lower stage or have no input channels . |
123,295 | public int getNumberOfOutputExecutionVertices ( ) { int retVal = 0 ; final Iterator < ExecutionGroupVertex > it = this . stageMembers . iterator ( ) ; while ( it . hasNext ( ) ) { final ExecutionGroupVertex groupVertex = it . next ( ) ; if ( groupVertex . isOutputVertex ( ) ) { retVal += groupVertex . getCurrentNumberO... | Returns the number of output execution vertices in this stage i . e . the number of execution vertices which are connected to vertices in a higher stage or have no output channels . |
123,296 | public void collectRequiredInstanceTypes ( final InstanceRequestMap instanceRequestMap , final ExecutionState executionState ) { final Set < AbstractInstance > collectedInstances = new HashSet < AbstractInstance > ( ) ; final ExecutionGroupVertexIterator groupIt = new ExecutionGroupVertexIterator ( this . getExecutionG... | Checks which instance types and how many instances of these types are required to execute this stage of the job graph . The required instance types and the number of instances are collected in the given map . Note that this method does not clear the map before collecting the instances . |
123,297 | void reconstructExecutionPipelines ( ) { Iterator < ExecutionGroupVertex > it = this . stageMembers . iterator ( ) ; final Set < ExecutionVertex > alreadyVisited = new HashSet < ExecutionVertex > ( ) ; while ( it . hasNext ( ) ) { final ExecutionGroupVertex groupVertex = it . next ( ) ; if ( ! groupVertex . isInputVert... | Reconstructs the execution pipelines for this execution stage . |
123,298 | private void reconstructExecutionPipeline ( final ExecutionVertex vertex , final boolean forward , final Set < ExecutionVertex > alreadyVisited ) { ExecutionPipeline pipeline = vertex . getExecutionPipeline ( ) ; if ( pipeline == null ) { pipeline = new ExecutionPipeline ( ) ; vertex . setExecutionPipeline ( pipeline )... | Reconstructs the execution pipeline starting at the given vertex by conducting a depth - first search . |
123,299 | public void check ( Plan plan ) { Preconditions . checkNotNull ( plan , "The passed plan is null." ) ; this . visitedNodes . clear ( ) ; plan . accept ( this ) ; } | Checks whether the given plan is valid . In particular it is checked that all contracts have the correct number of inputs and all inputs are of the expected type . In case of an invalid plan an extended RuntimeException is thrown . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.