idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
22,100
protected void handleMultiformPost ( final HttpServletRequest req , final HttpServletResponse resp , final Map < String , Object > multipart , final Session session ) throws ServletException , IOException { }
The post request is handed off to the implementor after the user is logged in .
22,101
public void gracefulShutdown ( final ExecutorService service , final Duration timeout ) throws InterruptedException { service . shutdown ( ) ; final long timeout_in_unit_of_miliseconds = timeout . toMillis ( ) ; if ( ! service . awaitTermination ( timeout_in_unit_of_miliseconds , MILLI_SECONDS_TIME_UNIT ) ) { service ....
Gracefully shuts down the given executor service .
22,102
private static UserGroupInformation createSecurityEnabledProxyUser ( String userToProxy , String fileLocation , Logger log ) throws IOException { if ( ! new File ( fileLocation ) . exists ( ) ) { throw new RuntimeException ( "hadoop token file doesn't exist." ) ; } log . info ( "Found token file. Setting " + HadoopSec...
Perform all the magic required to get the proxyUser in a securitized grid
22,103
public static UserGroupInformation setupProxyUser ( Properties jobProps , String tokenFile , Logger log ) { UserGroupInformation proxyUser = null ; if ( ! HadoopSecureWrapperUtils . shouldProxy ( jobProps ) ) { log . info ( "submitting job as original submitter, not proxying" ) ; return proxyUser ; } final Configuratio...
Sets up the UserGroupInformation proxyUser object so that calling code can do doAs returns null if the jobProps does not call for a proxyUser
22,104
@ SuppressWarnings ( "DefaultCharset" ) public static Properties loadAzkabanProps ( ) throws IOException { String propsFile = System . getenv ( ProcessJob . JOB_PROP_ENV ) ; Properties props = new Properties ( ) ; props . load ( new BufferedReader ( new FileReader ( propsFile ) ) ) ; return props ; }
Loading the properties file which is a combination of the jobProps file and sysProps file
22,105
public static boolean shouldProxy ( Properties props ) { String shouldProxy = props . getProperty ( HadoopSecurityManager . ENABLE_PROXYING ) ; return shouldProxy != null && shouldProxy . equals ( "true" ) ; }
Looks for particular properties inside the Properties object passed in and determines whether proxying should happen or not
22,106
private TimerTask getTimerTask ( ) { final TimeBasedReportingMetric < T > lockObject = this ; final TimerTask recurringReporting = new TimerTask ( ) { public void run ( ) { synchronized ( lockObject ) { preTrackingEventMethod ( ) ; notifyManager ( ) ; postTrackingEventMethod ( ) ; } } } ; return recurringReporting ; }
Get a TimerTask to reschedule Timer
22,107
public void updateInterval ( final long interval ) throws MetricException { if ( ! isValidInterval ( interval ) ) { throw new MetricException ( "Invalid interval: Cannot update timer" ) ; } logger . debug ( String . format ( "Updating tracking interval to %d milisecond for %s metric" , interval , getName ( ) ) ) ; this...
Method to change tracking interval
22,108
public Pair < ExecutionReference , ExecutableFlow > fetchHead ( ) throws InterruptedException { final Pair < ExecutionReference , ExecutableFlow > pair = this . queuedFlowList . take ( ) ; if ( pair != null && pair . getFirst ( ) != null ) { this . queuedFlowMap . remove ( pair . getFirst ( ) . getExecId ( ) ) ; } retu...
Wraps BoundedQueue Take method to have a corresponding update in queuedFlowMap lookup table
22,109
public void dequeue ( final int executionId ) { if ( this . queuedFlowMap . containsKey ( executionId ) ) { this . queuedFlowList . remove ( this . queuedFlowMap . get ( executionId ) ) ; this . queuedFlowMap . remove ( executionId ) ; } }
Helper method to have a single point of deletion in the queued flows
22,110
public ExecutableFlow getFlow ( final int executionId ) { if ( hasExecution ( executionId ) ) { return this . queuedFlowMap . get ( executionId ) . getSecond ( ) ; } return null ; }
Fetch flow for an execution . Returns null if execution not in queue
22,111
public ExecutionReference getReference ( final int executionId ) { if ( hasExecution ( executionId ) ) { return this . queuedFlowMap . get ( executionId ) . getFirst ( ) ; } return null ; }
Fetch Activereference for an execution . Returns null if execution not in queue
22,112
public void clear ( ) { for ( final Pair < ExecutionReference , ExecutableFlow > pair : this . queuedFlowMap . values ( ) ) { dequeue ( pair . getFirst ( ) . getExecId ( ) ) ; } }
Empties queue by dequeuing all the elements
22,113
protected static < T extends Serializable > T asT ( final Object service , final Class < T > type ) { return type . cast ( service ) ; }
Cast the object to the original one with the type . The object must extend Serializable .
22,114
public synchronized Project createNewProject ( final String name , final String description , final User creator ) throws ProjectManagerException { final ProjectResultHandler handler = new ProjectResultHandler ( ) ; try { final List < Project > projects = this . dbOperator . query ( ProjectResultHandler . SELECT_ACTIVE...
Creates a Project in the db .
22,115
private void addProjectToProjectVersions ( final DatabaseTransOperator transOperator , final int projectId , final int version , final File localFile , final String uploader , final byte [ ] md5 , final String resourceId ) throws ProjectManagerException { final long updateTime = System . currentTimeMillis ( ) ; final S...
Insert a new version record to TABLE project_versions before uploading files .
22,116
private void updateChunksInProjectVersions ( final DatabaseTransOperator transOperator , final int projectId , final int version , final int chunk ) throws ProjectManagerException { final String UPDATE_PROJECT_NUM_CHUNKS = "UPDATE project_versions SET num_chunks=? WHERE project_id=? AND version=?" ; try { transOperator...
we update num_chunks s actual number to db here .
22,117
public OtpErlangObject [ ] elements ( ) { if ( arity ( ) == 0 ) { return NO_ELEMENTS ; } final OtpErlangObject [ ] res = new OtpErlangObject [ arity ( ) ] ; System . arraycopy ( elems , 0 , res , 0 , res . length ) ; return res ; }
Get all the elements from the list as an array .
22,118
public String stringValue ( ) throws OtpErlangException { if ( ! isProper ( ) ) { throw new OtpErlangException ( "Non-proper list: " + this ) ; } final int [ ] values = new int [ arity ( ) ] ; for ( int i = 0 ; i < values . length ; ++ i ) { final OtpErlangObject o = elementAt ( i ) ; if ( ! ( o instanceof OtpErlangLon...
Convert a list of integers into a Unicode string interpreting each integer as a Unicode code point value .
22,119
public synchronized void put ( final Object o ) { final Bucket b = new Bucket ( o ) ; if ( tail != null ) { tail . setNext ( b ) ; tail = b ; } else { head = tail = b ; } count ++ ; notify ( ) ; }
Add an object to the tail of the queue .
22,120
public synchronized Object get ( ) { Object o = null ; while ( ( o = tryGet ( ) ) == null ) { try { this . wait ( ) ; } catch ( final InterruptedException e ) { } } return o ; }
Retrieve an object from the head of the queue or block until one arrives .
22,121
public synchronized Object get ( final long timeout ) throws InterruptedException { if ( status == closed ) { return null ; } long currentTime = System . currentTimeMillis ( ) ; final long stopTime = currentTime + timeout ; Object o = null ; while ( true ) { if ( ( o = tryGet ( ) ) != null ) { return o ; } currentTime ...
Retrieve an object from the head of the queue blocking until one arrives or until timeout occurs .
22,122
public Object tryGet ( ) { Object o = null ; if ( head != null ) { o = head . getContents ( ) ; head = head . getNext ( ) ; count -- ; if ( head == null ) { tail = null ; count = 0 ; } } return o ; }
attempt to retrieve message from queue head
22,123
public int size ( ) { if ( pad_bits == 0 ) { return bin . length ; } if ( bin . length == 0 ) { throw new java . lang . IllegalStateException ( "Impossible length" ) ; } return bin . length - 1 ; }
Get the size in whole bytes of the bitstr rest bits in the last byte not counted .
22,124
public void unPublishPort ( ) { OtpEpmd . unPublishPort ( this ) ; try { if ( super . epmd != null ) { super . epmd . close ( ) ; } } catch ( final IOException e ) { } super . epmd = null ; }
Unregister the server node s name and port number from the Erlang port mapper thus preventing any new connections from remote nodes .
22,125
public OtpConnection accept ( ) throws IOException , OtpAuthException { OtpTransport newsock = null ; while ( true ) { try { newsock = sock . accept ( ) ; return new OtpConnection ( this , newsock ) ; } catch ( final IOException e ) { try { if ( newsock != null ) { newsock . close ( ) ; } } catch ( final IOException f ...
Accept an incoming connection from a remote node . A call to this method will block until an incoming connection is at least attempted .
22,126
public OtpConnection connect ( final OtpSelf self ) throws IOException , UnknownHostException , OtpAuthException { return new OtpConnection ( self , this ) ; }
Create a connection to a remote node .
22,127
public void write4BE ( final long n ) { write ( ( byte ) ( ( n & 0xff000000 ) >> 24 ) ) ; write ( ( byte ) ( ( n & 0xff0000 ) >> 16 ) ) ; write ( ( byte ) ( ( n & 0xff00 ) >> 8 ) ) ; write ( ( byte ) ( n & 0xff ) ) ; }
Write the low four bytes of a value to the stream in big endian order .
22,128
public void writeLE ( final long n , final int b ) { long v = n ; for ( int i = 0 ; i < b ; i ++ ) { write ( ( byte ) ( v & 0xff ) ) ; v >>= 8 ; } }
Write any number of bytes in little endian format .
22,129
public void write4LE ( final long n ) { write ( ( byte ) ( n & 0xff ) ) ; write ( ( byte ) ( ( n & 0xff00 ) >> 8 ) ) ; write ( ( byte ) ( ( n & 0xff0000 ) >> 16 ) ) ; write ( ( byte ) ( ( n & 0xff000000 ) >> 24 ) ) ; }
Write the low four bytes of a value to the stream in little endian order .
22,130
public void write8LE ( final long n ) { write ( ( byte ) ( n & 0xff ) ) ; write ( ( byte ) ( n >> 8 & 0xff ) ) ; write ( ( byte ) ( n >> 16 & 0xff ) ) ; write ( ( byte ) ( n >> 24 & 0xff ) ) ; write ( ( byte ) ( n >> 32 & 0xff ) ) ; write ( ( byte ) ( n >> 40 & 0xff ) ) ; write ( ( byte ) ( n >> 48 & 0xff ) ) ; write (...
Write the low eight bytes of a value to the stream in little endian order .
22,131
public void poke4BE ( final int offset , final long n ) { if ( offset < super . count ) { buf [ offset + 0 ] = ( byte ) ( ( n & 0xff000000 ) >> 24 ) ; buf [ offset + 1 ] = ( byte ) ( ( n & 0xff0000 ) >> 16 ) ; buf [ offset + 2 ] = ( byte ) ( ( n & 0xff00 ) >> 8 ) ; buf [ offset + 3 ] = ( byte ) ( n & 0xff ) ; } }
Write the low four bytes of a value to the stream in bif endian order at the specified position . If the position specified is beyond the end of the stream this method will have no effect .
22,132
public void write_atom ( final String atom ) { String enc_atom ; byte [ ] bytes ; if ( atom . codePointCount ( 0 , atom . length ( ) ) <= OtpExternal . maxAtomLength ) { enc_atom = atom ; } else { enc_atom = new String ( OtpErlangString . stringToCodePoints ( atom ) , 0 , OtpExternal . maxAtomLength ) ; } try { bytes =...
Write a string to the stream as an Erlang atom .
22,133
public void write_binary ( final byte [ ] bin ) { write1 ( OtpExternal . binTag ) ; write4BE ( bin . length ) ; writeN ( bin ) ; }
Write an array of bytes to the stream as an Erlang binary .
22,134
public void write_bitstr ( final byte [ ] bin , final int pad_bits ) { if ( pad_bits == 0 ) { write_binary ( bin ) ; return ; } write1 ( OtpExternal . bitBinTag ) ; write4BE ( bin . length ) ; write1 ( 8 - pad_bits ) ; writeN ( bin ) ; }
Write an array of bytes to the stream as an Erlang bitstr .
22,135
public void write_tuple_head ( final int arity ) { if ( arity < 0xff ) { write1 ( OtpExternal . smallTupleTag ) ; write1 ( arity ) ; } else { write1 ( OtpExternal . largeTupleTag ) ; write4BE ( arity ) ; } }
Write an Erlang tuple header to the stream . After calling this method you must write arity elements to the stream or it will not be possible to decode it later .
22,136
public void write_ref ( final String node , final int id , final int creation ) { int ids [ ] = new int [ 1 ] ; ids [ 0 ] = id ; write_ref ( node , ids , creation ) ; }
Write an old style Erlang ref to the stream .
22,137
public void write_string ( final String s ) { final int len = s . length ( ) ; switch ( len ) { case 0 : write_nil ( ) ; break ; default : if ( len <= 65535 && is8bitString ( s ) ) { try { final byte [ ] bytebuf = s . getBytes ( "ISO-8859-1" ) ; write1 ( OtpExternal . stringTag ) ; write2BE ( len ) ; writeN ( bytebuf )...
Write a string to the stream .
22,138
public void write_compressed ( final OtpErlangObject o , final int level ) { @ SuppressWarnings ( "resource" ) final OtpOutputStream oos = new OtpOutputStream ( o ) ; if ( oos . size ( ) < 5 ) { try { oos . writeToAndFlush ( this ) ; close ( ) ; } catch ( final IOException e ) { throw new java . lang . IllegalArgumentE...
Write an arbitrary Erlang term to the stream in compressed format .
22,139
public String setCookie ( final String cookie ) { final String prev = this . cookie ; this . cookie = cookie ; return prev ; }
Set the authorization cookie used by this node .
22,140
protected int doHashCode ( ) { final OtpErlangObject . Hash hash = new OtpErlangObject . Hash ( 7 ) ; hash . combine ( creation , ids [ 0 ] ) ; if ( isNewRef ( ) ) { hash . combine ( ids [ 1 ] , ids [ 2 ] ) ; } return hash . valueOf ( ) ; }
Compute the hashCode value for a given ref . This function is compatible with equal .
22,141
public OtpErlangObject receive ( ) throws IOException , OtpErlangExit , OtpAuthException { try { return receiveMsg ( ) . getMsg ( ) ; } catch ( final OtpErlangDecodeException e ) { close ( ) ; throw new IOException ( e . getMessage ( ) ) ; } }
Receive a message from a remote process . This method blocks until a valid message is received or an exception is raised .
22,142
public OtpMsg receiveMsg ( ) throws IOException , OtpErlangExit , OtpAuthException { final Object o = queue . get ( ) ; if ( o instanceof OtpMsg ) { return ( OtpMsg ) o ; } else if ( o instanceof IOException ) { throw ( IOException ) o ; } else if ( o instanceof OtpErlangExit ) { throw ( OtpErlangExit ) o ; } else if (...
Receive a messge complete with sender and recipient information .
22,143
@ SuppressWarnings ( "resource" ) public void send ( final OtpErlangPid dest , final OtpErlangObject msg ) throws IOException { super . sendBuf ( self . pid ( ) , dest , new OtpOutputStream ( msg ) ) ; }
Send a message to a process on a remote node .
22,144
public void sendBuf ( final OtpErlangPid dest , final OtpOutputStream payload ) throws IOException { super . sendBuf ( self . pid ( ) , dest , payload ) ; }
Send a pre - encoded message to a process on a remote node .
22,145
public int bitLength ( ) { if ( bigVal != null ) { return bigVal . bitLength ( ) ; } if ( val == 0 || val == - 1 ) { return 0 ; } int i = 32 ; long m = ( 1L << i ) - 1 ; if ( val < 0 ) { m = ~ m ; for ( int j = i >> 1 ; j > 0 ; j >>= 1 ) { if ( ( val | m ) == val ) { i -= j ; m >>= j ; } else { i += j ; m <<= j ; } } i...
Returns the number of bits in the minimal two s - complement representation of this BigInteger excluding a sign bit .
22,146
public int intValue ( ) throws OtpErlangRangeException { final long l = longValue ( ) ; final int i = ( int ) l ; if ( i != l ) { throw new OtpErlangRangeException ( "Value too large for int: " + val ) ; } return i ; }
Get this number as an int .
22,147
public int uIntValue ( ) throws OtpErlangRangeException { final long l = longValue ( ) ; final int i = ( int ) l ; if ( i != l ) { throw new OtpErlangRangeException ( "Value too large for int: " + val ) ; } else if ( i < 0 ) { throw new OtpErlangRangeException ( "Value not positive: " + val ) ; } return i ; }
Get this number as a non - negative int .
22,148
public short shortValue ( ) throws OtpErlangRangeException { final long l = longValue ( ) ; final short i = ( short ) l ; if ( i != l ) { throw new OtpErlangRangeException ( "Value too large for short: " + val ) ; } return i ; }
Get this number as a short .
22,149
public short uShortValue ( ) throws OtpErlangRangeException { final long l = longValue ( ) ; final short i = ( short ) l ; if ( i != l ) { throw new OtpErlangRangeException ( "Value too large for short: " + val ) ; } else if ( i < 0 ) { throw new OtpErlangRangeException ( "Value not positive: " + val ) ; } return i ; }
Get this number as a non - negative short .
22,150
public char charValue ( ) throws OtpErlangRangeException { final long l = longValue ( ) ; final char i = ( char ) l ; if ( i != l ) { throw new OtpErlangRangeException ( "Value too large for char: " + val ) ; } return i ; }
Get this number as a char .
22,151
public byte byteValue ( ) throws OtpErlangRangeException { final long l = longValue ( ) ; final byte i = ( byte ) l ; if ( i != l ) { throw new OtpErlangRangeException ( "Value too large for byte: " + val ) ; } return i ; }
Get this number as a byte .
22,152
public void encode ( final OtpOutputStream buf ) { if ( bigVal != null ) { buf . write_big_integer ( bigVal ) ; } else { buf . write_long ( val ) ; } }
Convert this number to the equivalent Erlang external representation .
22,153
public void closeMbox ( final OtpMbox mbox , final OtpErlangObject reason ) { if ( mbox != null ) { mboxes . remove ( mbox ) ; mbox . name = null ; mbox . breakLinks ( reason ) ; } }
Close the specified mailbox with the given reason .
22,154
private boolean atomNeedsQuoting ( final String s ) { char c ; if ( s . length ( ) == 0 ) { return true ; } if ( ! isErlangLower ( s . charAt ( 0 ) ) ) { return true ; } final int len = s . length ( ) ; for ( int i = 1 ; i < len ; i ++ ) { c = s . charAt ( i ) ; if ( ! isErlangLetter ( c ) && ! isErlangDigit ( c ) && c...
true if the atom should be displayed with quotation marks
22,155
public void encode ( final OtpOutputStream buf ) { final int arity = elems . length ; buf . write_tuple_head ( arity ) ; for ( int i = 0 ; i < arity ; i ++ ) { buf . write_any ( elems [ i ] ) ; } }
Convert this tuple to the equivalent Erlang external representation .
22,156
public static int [ ] stringToCodePoints ( final String s ) { final int m = s . codePointCount ( 0 , s . length ( ) ) ; final int [ ] codePoints = new int [ m ] ; int j = 0 ; for ( int offset = 0 ; offset < s . length ( ) ; ) { final int codepoint = s . codePointAt ( offset ) ; codePoints [ j ++ ] = codepoint ; offset ...
Create Unicode code points from a String .
22,157
public void encode ( final OtpOutputStream buf ) { final int arity = arity ( ) ; buf . write_map_head ( arity ) ; for ( final Map . Entry < OtpErlangObject , OtpErlangObject > e : entrySet ( ) ) { buf . write_any ( e . getKey ( ) ) ; buf . write_any ( e . getValue ( ) ) ; } }
Convert this map to the equivalent Erlang external representation .
22,158
public void close ( ) { done = true ; connected = false ; synchronized ( this ) { try { if ( socket != null ) { if ( traceLevel >= ctrlThreshold ) { System . out . println ( "-> CLOSE" ) ; } socket . close ( ) ; } } catch ( final IOException e ) { } finally { socket = null ; } } }
Close the connection to the remote node .
22,159
protected synchronized void do_send ( final OtpOutputStream header ) throws IOException { try { if ( traceLevel >= ctrlThreshold ) { try { final OtpErlangObject h = header . getOtpInputStream ( 5 ) . read_any ( ) ; System . out . println ( "-> " + headerType ( h ) + " " + h ) ; } catch ( final OtpErlangDecodeException ...
used by the other message types
22,160
static String hex0 ( final byte x ) { final char tab [ ] = { '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' , 'a' , 'b' , 'c' , 'd' , 'e' , 'f' } ; int uint ; if ( x < 0 ) { uint = x & 0x7F ; uint |= 1 << 7 ; } else { uint = x ; } return "" + tab [ uint >>> 4 ] + tab [ uint & 0xF ] ; }
Used to debug print a message digest
22,161
private boolean digests_equals ( final byte [ ] a , final byte [ ] b ) { int i ; for ( i = 0 ; i < 16 ; ++ i ) { if ( a [ i ] != b [ i ] ) { return false ; } } return true ; }
Would use Array . equals in newer JDK ...
22,162
public int setPos ( final int pos ) { final int oldpos = super . pos ; int apos = pos ; if ( pos > super . count ) { apos = super . count ; } else if ( pos < 0 ) { apos = 0 ; } super . pos = apos ; return oldpos ; }
Set the current position in the stream .
22,163
public int readN ( final byte [ ] abuf , final int off , final int len ) throws OtpErlangDecodeException { if ( len == 0 && available ( ) == 0 ) { return 0 ; } final int i = super . read ( abuf , off , len ) ; if ( i < 0 ) { throw new OtpErlangDecodeException ( "Cannot read from input stream" ) ; } return i ; }
Read an array of bytes from the stream . The method reads at most len bytes from the input stream into offset off of the buffer .
22,164
public int peek1 ( ) throws OtpErlangDecodeException { int i ; try { i = super . buf [ super . pos ] ; if ( i < 0 ) { i += 256 ; } return i ; } catch ( final Exception e ) { throw new OtpErlangDecodeException ( "Cannot read from input stream" ) ; } }
Look ahead one position in the stream without consuming the byte found there .
22,165
public int read2BE ( ) throws OtpErlangDecodeException { final byte [ ] b = new byte [ 2 ] ; try { super . read ( b ) ; } catch ( final IOException e ) { throw new OtpErlangDecodeException ( "Cannot read from input stream" ) ; } return ( b [ 0 ] << 8 & 0xff00 ) + ( b [ 1 ] & 0xff ) ; }
Read a two byte big endian integer from the stream .
22,166
public int read4BE ( ) throws OtpErlangDecodeException { final byte [ ] b = new byte [ 4 ] ; try { super . read ( b ) ; } catch ( final IOException e ) { throw new OtpErlangDecodeException ( "Cannot read from input stream" ) ; } return ( b [ 0 ] << 24 & 0xff000000 ) + ( b [ 1 ] << 16 & 0xff0000 ) + ( b [ 2 ] << 8 & 0xf...
Read a four byte big endian integer from the stream .
22,167
public int read2LE ( ) throws OtpErlangDecodeException { final byte [ ] b = new byte [ 2 ] ; try { super . read ( b ) ; } catch ( final IOException e ) { throw new OtpErlangDecodeException ( "Cannot read from input stream" ) ; } return ( b [ 1 ] << 8 & 0xff00 ) + ( b [ 0 ] & 0xff ) ; }
Read a two byte little endian integer from the stream .
22,168
public int read4LE ( ) throws OtpErlangDecodeException { final byte [ ] b = new byte [ 4 ] ; try { super . read ( b ) ; } catch ( final IOException e ) { throw new OtpErlangDecodeException ( "Cannot read from input stream" ) ; } return ( b [ 3 ] << 24 & 0xff000000 ) + ( b [ 2 ] << 16 & 0xff0000 ) + ( b [ 1 ] << 8 & 0xf...
Read a four byte little endian integer from the stream .
22,169
public long readLE ( final int n ) throws OtpErlangDecodeException { final byte [ ] b = new byte [ n ] ; try { super . read ( b ) ; } catch ( final IOException e ) { throw new OtpErlangDecodeException ( "Cannot read from input stream" ) ; } long v = 0 ; int i = n ; while ( i -- > 0 ) { v = v << 8 | ( long ) b [ i ] & 0...
Read a little endian integer from the stream .
22,170
@ SuppressWarnings ( "fallthrough" ) public String read_atom ( ) throws OtpErlangDecodeException { int tag ; int len = - 1 ; byte [ ] strbuf ; String atom ; tag = read1skip_version ( ) ; switch ( tag ) { case OtpExternal . atomTag : len = read2BE ( ) ; strbuf = new byte [ len ] ; this . readN ( strbuf ) ; try { atom = ...
Read an Erlang atom from the stream .
22,171
public byte [ ] read_binary ( ) throws OtpErlangDecodeException { int tag ; int len ; byte [ ] bin ; tag = read1skip_version ( ) ; if ( tag != OtpExternal . binTag ) { throw new OtpErlangDecodeException ( "Wrong tag encountered, expected " + OtpExternal . binTag + ", got " + tag ) ; } len = read4BE ( ) ; bin = new byte...
Read an Erlang binary from the stream .
22,172
public byte [ ] read_bitstr ( final int pad_bits [ ] ) throws OtpErlangDecodeException { int tag ; int len ; byte [ ] bin ; tag = read1skip_version ( ) ; if ( tag != OtpExternal . bitBinTag ) { throw new OtpErlangDecodeException ( "Wrong tag encountered, expected " + OtpExternal . bitBinTag + ", got " + tag ) ; } len =...
Read an Erlang bitstr from the stream .
22,173
public double read_double ( ) throws OtpErlangDecodeException { int tag ; tag = read1skip_version ( ) ; switch ( tag ) { case OtpExternal . newFloatTag : { return Double . longBitsToDouble ( readBE ( 8 ) ) ; } case OtpExternal . floatTag : { BigDecimal val ; int epos ; int exp ; final byte [ ] strbuf = new byte [ 31 ] ...
Read an Erlang float from the stream .
22,174
public byte read_byte ( ) throws OtpErlangDecodeException { final long l = this . read_long ( false ) ; final byte i = ( byte ) l ; if ( l != i ) { throw new OtpErlangDecodeException ( "Value does not fit in byte: " + l ) ; } return i ; }
Read one byte from the stream .
22,175
public char read_char ( ) throws OtpErlangDecodeException { final long l = this . read_long ( true ) ; final char i = ( char ) l ; if ( l != ( i & 0xffffL ) ) { throw new OtpErlangDecodeException ( "Value does not fit in char: " + l ) ; } return i ; }
Read a character from the stream .
22,176
public int read_uint ( ) throws OtpErlangDecodeException { final long l = this . read_long ( true ) ; final int i = ( int ) l ; if ( l != ( i & 0xFFFFffffL ) ) { throw new OtpErlangDecodeException ( "Value does not fit in uint: " + l ) ; } return i ; }
Read an unsigned integer from the stream .
22,177
public short read_ushort ( ) throws OtpErlangDecodeException { final long l = this . read_long ( true ) ; final short i = ( short ) l ; if ( l != ( i & 0xffffL ) ) { throw new OtpErlangDecodeException ( "Value does not fit in ushort: " + l ) ; } return i ; }
Read an unsigned short from the stream .
22,178
public short read_short ( ) throws OtpErlangDecodeException { final long l = this . read_long ( false ) ; final short i = ( short ) l ; if ( l != i ) { throw new OtpErlangDecodeException ( "Value does not fit in short: " + l ) ; } return i ; }
Read a short from the stream .
22,179
public int read_list_head ( ) throws OtpErlangDecodeException { int arity = 0 ; final int tag = read1skip_version ( ) ; switch ( tag ) { case OtpExternal . nilTag : arity = 0 ; break ; case OtpExternal . stringTag : arity = read2BE ( ) ; break ; case OtpExternal . listTag : arity = read4BE ( ) ; break ; default : throw...
Read a list header from the stream .
22,180
public int read_tuple_head ( ) throws OtpErlangDecodeException { int arity = 0 ; final int tag = read1skip_version ( ) ; switch ( tag ) { case OtpExternal . smallTupleTag : arity = read1 ( ) ; break ; case OtpExternal . largeTupleTag : arity = read4BE ( ) ; break ; default : throw new OtpErlangDecodeException ( "Not va...
Read a tuple header from the stream .
22,181
public int read_nil ( ) throws OtpErlangDecodeException { int arity = 0 ; final int tag = read1skip_version ( ) ; switch ( tag ) { case OtpExternal . nilTag : arity = 0 ; break ; default : throw new OtpErlangDecodeException ( "Not valid nil tag: " + tag ) ; } return arity ; }
Read an empty list from the stream .
22,182
public OtpErlangPid read_pid ( ) throws OtpErlangDecodeException { String node ; int id ; int serial ; int creation ; int tag ; tag = read1skip_version ( ) ; if ( tag != OtpExternal . pidTag && tag != OtpExternal . newPidTag ) { throw new OtpErlangDecodeException ( "Wrong tag encountered, expected " + OtpExternal . pid...
Read an Erlang PID from the stream .
22,183
public OtpErlangPort read_port ( ) throws OtpErlangDecodeException { String node ; int id ; int creation ; int tag ; tag = read1skip_version ( ) ; if ( tag != OtpExternal . portTag && tag != OtpExternal . newPortTag ) { throw new OtpErlangDecodeException ( "Wrong tag encountered, expected " + OtpExternal . portTag + " ...
Read an Erlang port from the stream .
22,184
public OtpErlangRef read_ref ( ) throws OtpErlangDecodeException { String node ; int id ; int creation ; int tag ; tag = read1skip_version ( ) ; switch ( tag ) { case OtpExternal . refTag : node = read_atom ( ) ; id = read4BE ( ) & 0x3ffff ; creation = read1 ( ) & 0x03 ; return new OtpErlangRef ( node , id , creation )...
Read an Erlang reference from the stream .
22,185
public String read_string ( ) throws OtpErlangDecodeException { int tag ; int len ; byte [ ] strbuf ; int [ ] intbuf ; tag = read1skip_version ( ) ; switch ( tag ) { case OtpExternal . stringTag : len = read2BE ( ) ; strbuf = new byte [ len ] ; this . readN ( strbuf ) ; return OtpErlangString . newString ( strbuf ) ; c...
Read a string from the stream .
22,186
public OtpErlangObject read_compressed ( ) throws OtpErlangDecodeException { final int tag = read1skip_version ( ) ; if ( tag != OtpExternal . compressedTag ) { throw new OtpErlangDecodeException ( "Wrong tag encountered, expected " + OtpExternal . compressedTag + ", got " + tag ) ; } final int size = read4BE ( ) ; fin...
Read a compressed term from the stream
22,187
public OtpErlangObject read_any ( ) throws OtpErlangDecodeException { final int tag = peek1skip_version ( ) ; switch ( tag ) { case OtpExternal . smallIntTag : case OtpExternal . intTag : case OtpExternal . smallBigTag : case OtpExternal . largeBigTag : return new OtpErlangLong ( this ) ; case OtpExternal . atomTag : c...
Read an arbitrary Erlang term from the stream .
22,188
public static boolean publishPort ( final OtpLocalNode node ) throws IOException { OtpTransport s = null ; s = r4_publish ( node ) ; node . setEpmd ( s ) ; return s != null ; }
Register with Epmd so that other nodes are able to find and connect to it .
22,189
public static void unPublishPort ( final OtpLocalNode node ) { OtpTransport s = null ; try { s = node . createTransport ( ( String ) null , EpmdPort . get ( ) ) ; @ SuppressWarnings ( "resource" ) final OtpOutputStream obuf = new OtpOutputStream ( ) ; obuf . write2BE ( node . alive ( ) . length ( ) + 1 ) ; obuf . write...
Unregister from Epmd . Other nodes wishing to connect will no longer be able to .
22,190
public void send ( final String aname , final OtpErlangObject msg ) { home . deliver ( new OtpMsg ( self , aname , ( OtpErlangObject ) msg . clone ( ) ) ) ; }
Send a message to a named mailbox created from the same node as this mailbox .
22,191
public void send ( final String aname , final String node , final OtpErlangObject msg ) { try { final String currentNode = home . node ( ) ; if ( node . equals ( currentNode ) ) { send ( aname , msg ) ; } else if ( node . indexOf ( '@' , 0 ) < 0 && node . equals ( currentNode . substring ( 0 , currentNode . indexOf ( '...
Send a message to a named mailbox created from another node .
22,192
void breakLinks ( final OtpErlangObject reason ) { final Link [ ] l = links . clearLinks ( ) ; if ( l != null ) { final int len = l . length ; for ( int i = 0 ; i < len ; i ++ ) { exit ( 1 , l [ i ] . remote ( ) , reason ) ; } } }
used to break all known links to this mbox
22,193
public void read_lock_frames ( Job job ) { Frame tr = train ( ) ; if ( tr != null ) tr . read_lock ( job . _key ) ; if ( _valid != null && ! _train . equals ( _valid ) ) _valid . get ( ) . read_lock ( job . _key ) ; }
Read - Lock both training and validation User frames .
22,194
public void read_unlock_frames ( Job job ) { Frame tr = train ( ) ; if ( tr != null ) tr . unlock ( job . _key , false ) ; if ( _valid != null && ! _train . equals ( _valid ) ) valid ( ) . unlock ( job . _key , false ) ; }
Read - UnLock both training and validation User frames . This method is called on crashing cleanup pathes so handles the case where the frames are not actually locked .
22,195
public Frame reorderColumns ( Frame f ) { if ( ( _interactionsOnly == null ) || ( f == null ) ) return f ; Vec [ ] interOnlyVecs = f . vecs ( _interactionsOnly ) ; f . remove ( _interactionsOnly ) ; for ( int i = 0 ; i < _interactionsOnly . length ; i ++ ) { if ( isUsed ( _interactionsOnly [ i ] ) ) { f . add ( _intera...
Reorders columns of a Frame so that columns that only used to make interactions are at the end of the Frame . Only Vecs that will actually be used are kept in the frame .
22,196
public String [ ] classNames ( ) { if ( _domains == null || _domains . length == 0 || ! isSupervised ( ) ) return null ; return _domains [ _domains . length - 1 ] ; }
Names of levels for a categorical response column .
22,197
private void validateS3Credentials ( final PersistS3CredentialsV3 s3Credentials ) { Objects . requireNonNull ( s3Credentials ) ; if ( s3Credentials . secret_key_id == null ) throw new IllegalArgumentException ( "The field 'S3_SECRET_KEY_ID' may not be null." ) ; if ( s3Credentials . secret_access_key == null ) throw ne...
Checks for basic mistakes users might make when providing S3 credentials .
22,198
private Vec [ ] [ ] makeTemplates ( Frame dataset , double [ ] ratios ) { Vec anyVec = dataset . anyVec ( ) ; final long [ ] [ ] espcPerSplit = computeEspcPerSplit ( anyVec . espc ( ) , anyVec . length ( ) , ratios ) ; final int num = dataset . numCols ( ) ; final int nsplits = espcPerSplit . length ; final String [ ] ...
Make vector templates for all output frame vectors
22,199
static long [ ] [ ] computeEspcPerSplit ( long [ ] espc , long len , double [ ] ratios ) { assert espc . length > 0 && espc [ 0 ] == 0 ; assert espc [ espc . length - 1 ] == len ; long [ ] partSizes = partitione ( len , ratios ) ; int nparts = ratios . length + 1 ; long [ ] [ ] r = new long [ nparts ] [ espc . length ]...
The task computes ESPC per split