idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
40,800
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 .
40,801
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 .
40,802
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 .
40,803
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 .
40,804
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 .
40,805
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 .
40,806
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 .
40,807
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 .
40,808
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 .
40,809
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
40,810
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 .
40,811
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 .
40,812
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 .
40,813
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 .
40,814
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 .
40,815
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 .
40,816
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 .
40,817
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 .
40,818
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 .
40,819
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 .
40,820
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 .
40,821
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 .
40,822
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 .
40,823
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 .
40,824
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 .
40,825
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 .
40,826
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 .
40,827
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 .
40,828
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 .
40,829
@ 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 .
40,830
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 .
40,831
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
40,832
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 .
40,833
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 .
40,834
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 .
40,835
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 .
40,836
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 .
40,837
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 .
40,838
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 .
40,839
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 .
40,840
public boolean preVisit ( Operator < ? > node ) { if ( ! this . visitedNodes . add ( node ) ) { return false ; } if ( node instanceof FileDataSinkBase ) { checkFileDataSink ( ( FileDataSinkBase < ? > ) node ) ; } else if ( node instanceof FileDataSourceBase ) { checkFileDataSource ( ( FileDataSourceBase < ? > ) node ) ...
Checks whether the node is correctly connected to its input .
40,841
private void checkDataSink ( GenericDataSinkBase < ? > dataSinkContract ) { Operator < ? > input = dataSinkContract . getInput ( ) ; if ( input == null ) { throw new MissingChildException ( ) ; } }
Checks if DataSinkContract is correctly connected . In case that the contract is incorrectly connected a RuntimeException is thrown .
40,842
private void checkFileDataSink ( FileDataSinkBase < ? > fileSink ) { String path = fileSink . getFilePath ( ) ; if ( path == null ) { throw new InvalidProgramException ( "File path of FileDataSink is null." ) ; } if ( path . length ( ) == 0 ) { throw new InvalidProgramException ( "File path of FileDataSink is empty str...
Checks if FileDataSink is correctly connected . In case that the contract is incorrectly connected a RuntimeException is thrown .
40,843
private void checkFileDataSource ( FileDataSourceBase < ? > fileSource ) { String path = fileSource . getFilePath ( ) ; if ( path == null ) { throw new InvalidProgramException ( "File path of FileDataSource is null." ) ; } if ( path . length ( ) == 0 ) { throw new InvalidProgramException ( "File path of FileDataSource ...
Checks if FileDataSource is correctly connected . In case that the contract is incorrectly connected a RuntimeException is thrown .
40,844
private void checkSingleInputContract ( SingleInputOperator < ? , ? , ? > singleInputContract ) { Operator < ? > input = singleInputContract . getInput ( ) ; if ( input == null ) { throw new MissingChildException ( ) ; } }
Checks whether a SingleInputOperator is correctly connected . In case that the contract is incorrectly connected a RuntimeException is thrown .
40,845
private void checkDualInputContract ( DualInputOperator < ? , ? , ? , ? > dualInputContract ) { Operator < ? > input1 = dualInputContract . getFirstInput ( ) ; Operator < ? > input2 = dualInputContract . getSecondInput ( ) ; if ( input1 == null || input2 == null ) { throw new MissingChildException ( ) ; } }
Checks whether a DualInputOperator is correctly connected . In case that the contract is incorrectly connected a RuntimeException is thrown .
40,846
public O setParallelism ( int dop ) { if ( dop < 1 ) { throw new IllegalArgumentException ( "The parallelism of an operator must be at least 1." ) ; } this . dop = dop ; @ SuppressWarnings ( "unchecked" ) O returnType = ( O ) this ; return returnType ; }
Sets the degree of parallelism for this operator . The degree must be 1 or more .
40,847
public static < T > Operator < T > createUnionCascade ( Operator < T > input1 , Operator < T > ... input2 ) { if ( input2 == null || input2 . length == 0 ) { return input1 ; } else if ( input2 . length == 1 && input1 == null ) { return input2 [ 0 ] ; } TypeInformation < T > type = null ; if ( input1 != null ) { type = ...
Takes a single Operator and a list of operators and creates a cascade of unions of this inputs if needed . If not needed there was only one operator as input then this operator is returned .
40,848
protected boolean acceptFile ( FileStatus fileStatus ) { final String name = fileStatus . getPath ( ) . getName ( ) ; return ! name . startsWith ( "_" ) && ! name . startsWith ( "." ) ; }
A simple hook to filter files and directories from the input . The method may be overridden . Hadoop s FileInputFormat has a similar mechanism and applies the same filters by default .
40,849
public void append ( final byte [ ] data , final int start , final int len ) { final int oldLength = this . bytes . length ; setCapacity ( this . bytes . length + len , true ) ; System . arraycopy ( data , start , this . bytes , oldLength , len ) ; }
Append a range of bytes to the end of the given data .
40,850
public static boolean isNonStaticInnerClass ( Class < ? > clazz ) { if ( clazz . getEnclosingClass ( ) == null ) { return false ; } else { if ( clazz . getDeclaringClass ( ) != null ) { return ! Modifier . isStatic ( clazz . getModifiers ( ) ) ; } else { return true ; } } }
Checks whether the class is an inner class that is not statically accessible . That is especially true for anonymous inner classes .
40,851
public ManagementGroupVertex getGroupVertex ( final int index ) { if ( index < this . groupVertices . size ( ) ) { return this . groupVertices . get ( index ) ; } return null ; }
Returns the management group vertex with the given index .
40,852
void addGroupVertex ( final ManagementGroupVertex groupVertex ) { this . groupVertices . add ( groupVertex ) ; this . managementGraph . addGroupVertex ( groupVertex . getID ( ) , groupVertex ) ; }
Adds the given group vertex to this management stage .
40,853
void collectGroupVertices ( final List < ManagementGroupVertex > groupVertices ) { final Iterator < ManagementGroupVertex > it = this . groupVertices . iterator ( ) ; while ( it . hasNext ( ) ) { groupVertices . add ( it . next ( ) ) ; } }
Adds all management group vertices contained in this stage to the given list .
40,854
void collectVertices ( final List < ManagementVertex > vertices ) { final Iterator < ManagementGroupVertex > it = this . groupVertices . iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) . collectVertices ( vertices ) ; } }
Adds all management vertices contained in this stage s group vertices to the given list .
40,855
public int getNumberOfInputManagementVertices ( ) { int retVal = 0 ; final Iterator < ManagementGroupVertex > it = this . groupVertices . iterator ( ) ; while ( it . hasNext ( ) ) { final ManagementGroupVertex groupVertex = it . next ( ) ; if ( groupVertex . isInputVertex ( ) ) { retVal += groupVertex . getNumberOfGrou...
Returns the number of input management vertices in this stage i . e . the number of management vertices which are connected to vertices in a lower stage or have no input channels .
40,856
public int getNumberOfOutputManagementVertices ( ) { int retVal = 0 ; final Iterator < ManagementGroupVertex > it = this . groupVertices . iterator ( ) ; while ( it . hasNext ( ) ) { final ManagementGroupVertex groupVertex = it . next ( ) ; if ( groupVertex . isOutputVertex ( ) ) { retVal += groupVertex . getNumberOfGr...
Returns the number of output management vertices in this stage i . e . the number of management vertices which are connected to vertices in a higher stage or have no output channels .
40,857
public int getNumberOfInputGroupVertices ( ) { int retVal = 0 ; final Iterator < ManagementGroupVertex > it = this . groupVertices . iterator ( ) ; while ( it . hasNext ( ) ) { if ( it . next ( ) . isInputVertex ( ) ) { ++ retVal ; } } return retVal ; }
Returns the number of input group vertices in this stage . Input group vertices are those vertices which have incoming edges from group vertices of a lower stage .
40,858
public ManagementGroupVertex getInputGroupVertex ( int index ) { final Iterator < ManagementGroupVertex > it = this . groupVertices . iterator ( ) ; while ( it . hasNext ( ) ) { final ManagementGroupVertex groupVertex = it . next ( ) ; if ( groupVertex . isInputVertex ( ) ) { if ( index == 0 ) { return groupVertex ; } ...
Returns the input group vertex in this stage with the given index . Input group vertices are those vertices which have incoming edges from group vertices of a lower stage .
40,859
public int getNumberOfOutputGroupVertices ( ) { int retVal = 0 ; final Iterator < ManagementGroupVertex > it = this . groupVertices . iterator ( ) ; while ( it . hasNext ( ) ) { if ( it . next ( ) . isOutputVertex ( ) ) { ++ retVal ; } } return retVal ; }
Returns the number of output group vertices in this stage . Output group vertices are those vertices which have outgoing edges to group vertices of a higher stage .
40,860
public ManagementGroupVertex getOutputGroupVertex ( int index ) { final Iterator < ManagementGroupVertex > it = this . groupVertices . iterator ( ) ; while ( it . hasNext ( ) ) { final ManagementGroupVertex groupVertex = it . next ( ) ; if ( groupVertex . isOutputVertex ( ) ) { if ( index == 0 ) { return groupVertex ; ...
Returns the output group vertex in this stage with the given index . Output group vertices are those vertices which have outgoing edges to group vertices of a higher stage .
40,861
public static HardwareDescription extractFromSystem ( ) { int numberOfCPUCores = Runtime . getRuntime ( ) . availableProcessors ( ) ; long sizeOfPhysicalMemory = getSizeOfPhysicalMemory ( ) ; if ( sizeOfPhysicalMemory < 0 ) { sizeOfPhysicalMemory = 1 ; } long sizeOfFreeMemory = getSizeOfFreeMemory ( ) ; return new Hard...
Extracts a hardware description object from the system .
40,862
private static long getSizeOfFreeMemory ( ) { float fractionToUse = GlobalConfiguration . getFloat ( ConfigConstants . TASK_MANAGER_MEMORY_FRACTION_KEY , ConfigConstants . DEFAULT_MEMORY_MANAGER_MEMORY_FRACTION ) ; Runtime r = Runtime . getRuntime ( ) ; long max = r . maxMemory ( ) ; long total = r . totalMemory ( ) ; ...
Returns the size of free memory in bytes available to the JVM .
40,863
@ SuppressWarnings ( "resource" ) private static long getSizeOfPhysicalMemoryForLinux ( ) { BufferedReader lineReader = null ; try { lineReader = new BufferedReader ( new FileReader ( LINUX_MEMORY_INFO_PATH ) ) ; String line = null ; while ( ( line = lineReader . readLine ( ) ) != null ) { Matcher matcher = LINUX_MEMOR...
Returns the size of the physical memory in bytes on a Linux - based operating system .
40,864
private static long getSizeOfPhysicalMemoryForMac ( ) { BufferedReader bi = null ; try { Process proc = Runtime . getRuntime ( ) . exec ( "sysctl hw.memsize" ) ; bi = new BufferedReader ( new InputStreamReader ( proc . getInputStream ( ) ) ) ; String line ; while ( ( line = bi . readLine ( ) ) != null ) { if ( line . s...
Returns the size of the physical memory in bytes on a Mac OS - based operating system
40,865
void insertForwardEdge ( final ManagementEdge managementEdge , final int index ) { while ( index >= this . forwardEdges . size ( ) ) { this . forwardEdges . add ( null ) ; } this . forwardEdges . set ( index , managementEdge ) ; }
Adds a new edge which originates at this gate .
40,866
void insertBackwardEdge ( final ManagementEdge managementEdge , final int index ) { while ( index >= this . backwardEdges . size ( ) ) { this . backwardEdges . add ( null ) ; } this . backwardEdges . set ( index , managementEdge ) ; }
Adds a new edge which arrives at this gate .
40,867
public ManagementEdge getForwardEdge ( final int index ) { if ( index < this . forwardEdges . size ( ) ) { return this . forwardEdges . get ( index ) ; } return null ; }
Returns the edge originating at the given index .
40,868
public ManagementEdge getBackwardEdge ( final int index ) { if ( index < this . backwardEdges . size ( ) ) { return this . backwardEdges . get ( index ) ; } return null ; }
Returns the edge arriving at the given index .
40,869
private boolean currentGateLeadsToOtherStage ( final TraversalEntry te , final boolean forward ) { final ManagementGroupVertex groupVertex = te . getManagementVertex ( ) . getGroupVertex ( ) ; if ( forward ) { if ( te . getCurrentGate ( ) >= groupVertex . getNumberOfForwardEdges ( ) ) { return false ; } final Managemen...
Checks if the current gate leads to another stage or not .
40,870
public RequestedLocalProperties filterByNodesConstantSet ( OptimizerNode node , int input ) { if ( this . ordering != null ) { final FieldList involvedIndexes = this . ordering . getInvolvedIndexes ( ) ; for ( int i = 0 ; i < involvedIndexes . size ( ) ; i ++ ) { if ( ! node . isFieldConstant ( input , involvedIndexes ...
Filters these properties by what can be preserved through a user function s constant fields set . Since interesting properties are filtered top - down anything that partially destroys the ordering makes the properties uninteresting .
40,871
public void parameterizeChannel ( Channel channel ) { if ( this . ordering != null ) { channel . setLocalStrategy ( LocalStrategy . SORT , this . ordering . getInvolvedIndexes ( ) , this . ordering . getFieldSortDirections ( ) ) ; } else if ( this . groupedFields != null ) { boolean [ ] dirs = new boolean [ this . grou...
Parameterizes the local strategy fields of a channel such that the channel produces the desired local properties .
40,872
public static < T extends Enum < T > > T readEnum ( final DataInput in , final Class < T > enumType ) throws IOException { if ( ! in . readBoolean ( ) ) { return null ; } return T . valueOf ( enumType , StringRecord . readString ( in ) ) ; }
Reads a value from the given enumeration from the specified input stream .
40,873
public static void writeEnum ( final DataOutput out , final Enum < ? > enumVal ) throws IOException { if ( enumVal == null ) { out . writeBoolean ( false ) ; } else { out . writeBoolean ( true ) ; StringRecord . writeString ( out , enumVal . name ( ) ) ; } }
Writes a value of an enumeration to the given output stream .
40,874
public void set ( final byte [ ] utf8 , final int start , final int len ) { setCapacity ( len , false ) ; System . arraycopy ( utf8 , start , bytes , 0 , len ) ; this . length = len ; this . hash = 0 ; }
Set the Text to range of bytes
40,875
private void applyUserDefinedSettings ( final HashMap < AbstractJobVertex , ExecutionGroupVertex > temporaryGroupVertexMap ) throws GraphConversionException { final Iterator < Map . Entry < AbstractJobVertex , ExecutionGroupVertex > > it = temporaryGroupVertexMap . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( )...
Applies the user defined settings to the execution graph .
40,876
private void constructExecutionGraph ( final JobGraph jobGraph , final InstanceManager instanceManager ) throws GraphConversionException { final HashMap < AbstractJobVertex , ExecutionVertex > temporaryVertexMap = new HashMap < AbstractJobVertex , ExecutionVertex > ( ) ; final HashMap < AbstractJobVertex , ExecutionGro...
Sets up an execution graph from a job graph .
40,877
private void createInitialGroupEdges ( final HashMap < AbstractJobVertex , ExecutionVertex > vertexMap ) throws GraphConversionException { Iterator < Map . Entry < AbstractJobVertex , ExecutionVertex > > it = vertexMap . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final Map . Entry < AbstractJobVertex , ...
Creates the initial edges between the group vertices
40,878
public ExecutionVertex getInputVertex ( final int stage , final int index ) { try { final ExecutionStage s = this . stages . get ( stage ) ; if ( s == null ) { return null ; } return s . getInputExecutionVertex ( index ) ; } catch ( ArrayIndexOutOfBoundsException e ) { return null ; } }
Returns the input vertex with the specified index for the given stage
40,879
public ExecutionVertex getVertexByChannelID ( final ChannelID id ) { final ExecutionEdge edge = this . edgeMap . get ( id ) ; if ( edge == null ) { return null ; } if ( id . equals ( edge . getOutputChannelID ( ) ) ) { return edge . getOutputGate ( ) . getVertex ( ) ; } return edge . getInputGate ( ) . getVertex ( ) ; ...
Identifies an execution by the specified channel ID and returns it .
40,880
void registerExecutionVertex ( final ExecutionVertex vertex ) { if ( this . vertexMap . put ( vertex . getID ( ) , vertex ) != null ) { throw new IllegalStateException ( "There is already an execution vertex with ID " + vertex . getID ( ) + " registered" ) ; } }
Registers an execution vertex with the execution graph .
40,881
private boolean isCurrentStageCompleted ( ) { if ( this . indexToCurrentExecutionStage >= this . stages . size ( ) ) { return true ; } final ExecutionGraphIterator it = new ExecutionGraphIterator ( this , this . indexToCurrentExecutionStage , true , true ) ; while ( it . hasNext ( ) ) { final ExecutionVertex vertex = i...
Checks if the current execution stage has been successfully completed i . e . all vertices in this stage have successfully finished their execution .
40,882
private void reconstructExecutionPipelines ( ) { final Iterator < ExecutionStage > it = this . stages . iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) . reconstructExecutionPipelines ( ) ; } }
Reconstructs the execution pipelines for the entire execution graph .
40,883
private void calculateConnectionIDs ( ) { final Set < ExecutionGroupVertex > alreadyVisited = new HashSet < ExecutionGroupVertex > ( ) ; final ExecutionStage lastStage = getStage ( getNumberOfStages ( ) - 1 ) ; for ( int i = 0 ; i < lastStage . getNumberOfStageMembers ( ) ; ++ i ) { final ExecutionGroupVertex groupVert...
Calculates the connection IDs of the graph to avoid deadlocks in the data flow at runtime .
40,884
public void configure ( Configuration parameters ) { this . driverName = parameters . getString ( DRIVER_KEY , null ) ; this . username = parameters . getString ( USERNAME_KEY , null ) ; this . password = parameters . getString ( PASSWORD_KEY , null ) ; this . dbURL = parameters . getString ( URL_KEY , null ) ; this . ...
Configures this JDBCOutputFormat .
40,885
public void open ( int taskNumber , int numTasks ) throws IOException { try { establishConnection ( ) ; upload = dbConn . prepareStatement ( query ) ; } catch ( SQLException sqe ) { throw new IllegalArgumentException ( "open() failed:\t!" , sqe ) ; } catch ( ClassNotFoundException cnfe ) { throw new IllegalArgumentExce...
Connects to the target database and initializes the prepared statement .
40,886
public void writeToOutput ( final ChannelWriterOutputView output ) throws IOException { int recordsLeft = this . numRecords ; int currentMemSeg = 0 ; while ( recordsLeft > 0 ) { final MemorySegment currentIndexSegment = this . sortIndex . get ( currentMemSeg ++ ) ; int offset = 0 ; if ( recordsLeft >= this . indexEntri...
Writes the records in this buffer in their logical order to the given output .
40,887
void addInitialSubtask ( final ExecutionVertex ev ) { if ( ev == null ) { throw new IllegalArgumentException ( "Argument ev must not be null" ) ; } if ( this . initialGroupMemberAdded . compareAndSet ( false , true ) ) { this . groupMembers . add ( ev ) ; } }
Adds the initial execution vertex to this group vertex .
40,888
public ExecutionVertex getGroupMember ( final int pos ) { if ( pos < 0 ) { throw new IllegalArgumentException ( "Argument pos must be greater or equal to 0" ) ; } try { return this . groupMembers . get ( pos ) ; } catch ( ArrayIndexOutOfBoundsException e ) { return null ; } }
Returns a specific execution vertex from the list of members .
40,889
ExecutionGroupEdge wireTo ( final ExecutionGroupVertex groupVertex , final int indexOfInputGate , final int indexOfOutputGate , final ChannelType channelType , final boolean userDefinedChannelType , final DistributionPattern distributionPattern ) throws GraphConversionException { try { final ExecutionGroupEdge previous...
Wires this group vertex to the specified group vertex and creates a back link .
40,890
boolean isWiredTo ( final ExecutionGroupVertex groupVertex ) { final Iterator < ExecutionGroupEdge > it = this . forwardLinks . iterator ( ) ; while ( it . hasNext ( ) ) { final ExecutionGroupEdge edge = it . next ( ) ; if ( edge . getTargetVertex ( ) == groupVertex ) { return true ; } } return false ; }
Checks if this group vertex is wired to the given group vertex .
40,891
void createInitialExecutionVertices ( final int initalNumberOfVertices ) throws GraphConversionException { if ( initalNumberOfVertices == this . getCurrentNumberOfGroupMembers ( ) ) { return ; } if ( this . getCurrentNumberOfGroupMembers ( ) != 1 ) { throw new IllegalStateException ( "This method can only be called for...
Creates the initial execution vertices managed by this group vertex .
40,892
public void subscribeToEvent ( final EventListener eventListener , final Class < ? extends AbstractTaskEvent > eventType ) { synchronized ( this . subscriptions ) { List < EventListener > subscribers = this . subscriptions . get ( eventType ) ; if ( subscribers == null ) { subscribers = new ArrayList < EventListener > ...
Subscribes the given event listener object to the specified event type .
40,893
public void deliverEvent ( AbstractTaskEvent event ) { synchronized ( this . subscriptions ) { List < EventListener > subscribers = this . subscriptions . get ( event . getClass ( ) ) ; if ( subscribers == null ) { return ; } final Iterator < EventListener > it = subscribers . iterator ( ) ; while ( it . hasNext ( ) ) ...
Delivers a event to all of the registered subscribers .
40,894
void changeChannelType ( final ChannelType newChannelType ) throws GraphConversionException { if ( ! this . channelType . equals ( newChannelType ) && this . userDefinedChannelType ) { throw new GraphConversionException ( "Cannot overwrite user defined channel type" ) ; } this . channelType = newChannelType ; }
Changes the channel type for this edge .
40,895
public void subscribeToEvent ( EventListener eventListener , Class < ? extends AbstractTaskEvent > eventType ) { this . eventHandler . subscribeToEvent ( eventListener , eventType ) ; }
Subscribes the listener object to receive events of the given type .
40,896
public void unsubscribeFromEvent ( EventListener eventListener , Class < ? extends AbstractTaskEvent > eventType ) { this . eventHandler . unsubscribeFromEvent ( eventListener , eventType ) ; }
Removes the subscription for events of the given type for the listener object .
40,897
public static void checkTransition ( boolean jobManager , String taskName , ExecutionState oldState , ExecutionState newState ) { LOG . info ( ( jobManager ? "JM: " : "TM: " ) + "ExecutionState set from " + oldState + " to " + newState + " for task " + taskName ) ; boolean unexpectedStateChange = true ; if ( oldState =...
Checks the transition of the execution state and outputs an error in case of an unexpected state transition .
40,898
protected int getFirstFreeOutputGateIndex ( ) { for ( int i = 0 ; i < this . forwardEdges . size ( ) ; i ++ ) { if ( this . forwardEdges . get ( i ) == null ) { return i ; } } return this . forwardEdges . size ( ) ; }
Returns the index of this vertex s first free output gate .
40,899
protected int getFirstFreeInputGateIndex ( ) { for ( int i = 0 ; i < this . backwardEdges . size ( ) ; i ++ ) { if ( this . backwardEdges . get ( i ) == null ) { return i ; } } return this . backwardEdges . size ( ) ; }
Returns the index of this vertex s first free input gate .