idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
17,300 | private IntVar getEarlyVar ( ) { IntVar earlyVar = null ; for ( int i = stays . nextSetBit ( 0 ) ; i >= 0 ; i = stays . nextSetBit ( i + 1 ) ) { if ( starts [ i ] != null && ! starts [ i ] . isInstantiated ( ) ) { if ( earlyVar == null ) { earlyVar = starts [ i ] ; } else { if ( earlyVar . getLB ( ) > starts [ i ] . ge... | Get the earliest un - instantiated start moment |
17,301 | private IntVar getVMtoLeafNode ( ) { for ( int x = 0 ; x < outs . length ; x ++ ) { if ( outs [ x ] . cardinality ( ) == 0 ) { BitSet in = ins [ x ] ; for ( int i = in . nextSetBit ( 0 ) ; i >= 0 ; i = in . nextSetBit ( i + 1 ) ) { if ( starts [ i ] != null && ! starts [ i ] . isInstantiated ( ) ) { return starts [ i ]... | Get the start moment for a VM that move to a node where no VM will leave this node . This way we are pretty sure the action can be scheduled at 0 . |
17,302 | protected void initBytes ( StringBuilder source ) { if ( this . bytes == null ) { if ( this . string != null ) { String encodingValue = getEncoding ( ) ; try { this . bytes = this . string . getBytes ( encodingValue ) ; } catch ( UnsupportedEncodingException e ) { source . append ( ".encoding" ) ; throw new NlsIllegalA... | This method initializes the internal byte array . |
17,303 | private void convertLink2Record ( final Object iKey ) { if ( status == MULTIVALUE_CONTENT_TYPE . ALL_RECORDS ) return ; final Object value ; if ( iKey instanceof ORID ) value = iKey ; else value = super . get ( iKey ) ; if ( value != null && value instanceof ORID ) { final ORID rid = ( ORID ) value ; marshalling = true... | Convert the item with the received key to a record . |
17,304 | public synchronized ODatabaseComplex < ? > register ( final ODatabaseComplex < ? > db ) { instances . put ( db , Thread . currentThread ( ) ) ; return db ; } | Registers a database . |
17,305 | public synchronized void unregister ( final OStorage iStorage ) { for ( ODatabaseComplex < ? > db : new HashSet < ODatabaseComplex < ? > > ( instances . keySet ( ) ) ) { if ( db != null && db . getStorage ( ) == iStorage ) { db . close ( ) ; instances . remove ( db ) ; } } } | Unregisters all the database instances that share the storage received as argument . |
17,306 | public synchronized void shutdown ( ) { if ( instances . size ( ) > 0 ) { OLogManager . instance ( ) . debug ( null , "Found %d databases opened during OrientDB shutdown. Assure to always close database instances after usage" , instances . size ( ) ) ; for ( ODatabaseComplex < ? > db : new HashSet < ODatabaseComplex < ... | Closes all open databases . |
17,307 | public String digest2String ( final String iInput , final boolean iIncludeAlgorithm ) { final StringBuilder buffer = new StringBuilder ( ) ; if ( iIncludeAlgorithm ) buffer . append ( ALGORITHM_PREFIX ) ; buffer . append ( OSecurityManager . instance ( ) . digest2String ( iInput ) ) ; return buffer . toString ( ) ; } | Hashes the input string . |
17,308 | private static Thread [ ] getThreads ( ThreadGroup g ) { int mul = 1 ; do { Thread [ ] arr = new Thread [ g . activeCount ( ) * mul + 1 ] ; if ( g . enumerate ( arr ) < arr . length ) { return arr ; } mul ++ ; } while ( true ) ; } | Returns threads in an array . Some elements may be null . |
17,309 | public int getThreadCount ( ThreadGroup group , Status ... s ) { Thread [ ] threads = getThreads ( group ) ; int count = 0 ; for ( Thread t : threads ) { if ( t instanceof MonitoredThread ) { Status status = getStatus ( ( MonitoredThread ) t ) ; if ( status != null ) { for ( Status x : s ) { if ( x == status ) { count ... | Return the count of threads that are in any of the statuses |
17,310 | public final Object assemble ( Serializable cached , Object owner ) throws HibernateException { if ( cached != null ) { log . trace ( "assemble " + cached + " (" + cached . getClass ( ) + "), owner is " + owner ) ; } return cached ; } | Returns the cached value . |
17,311 | public LobbyStatus createGroupFinderLobby ( int type , String uuid ) { return client . sendRpcAndWait ( SERVICE , "createGroupFinderLobby" , type , uuid ) ; } | Create a group finder lobby . Might be deprecated? |
17,312 | public Object call ( String uuid , GameMode mode , String procCall , JsonObject object ) { return client . sendRpcAndWait ( SERVICE , "call" , uuid , mode . name ( ) , procCall , object . toString ( ) ) ; } | Call a group finder action |
17,313 | @ SuppressWarnings ( "unchecked" ) public List < T > run ( final Object ... iArgs ) { final ODatabaseRecord database = ODatabaseRecordThreadLocal . INSTANCE . get ( ) ; if ( database == null ) throw new OQueryParsingException ( "No database configured" ) ; setParameters ( iArgs ) ; return ( List < T > ) database . getS... | Delegates to the OQueryExecutor the query execution . |
17,314 | public AddressbookQuery limitNumberOfResults ( int limit ) { if ( limit > 0 ) { addLimit ( WebDavSearch . NRESULTS , limit ) ; } else { removeLimit ( WebDavSearch . NRESULTS ) ; } return this ; } | Limit the number of results in the response if supported by the server . A negative value will remove the limit . |
17,315 | public void close ( ) { for ( Entry < String , OResourcePool < String , DB > > pool : pools . entrySet ( ) ) { for ( DB db : pool . getValue ( ) . getResources ( ) ) { pool . getValue ( ) . close ( ) ; try { OLogManager . instance ( ) . debug ( this , "Closing pooled database '%s'..." , db . getName ( ) ) ; ( ( ODataba... | Closes all the databases . |
17,316 | public static boolean isMultiValue ( final Class < ? > iType ) { return ( iType . isArray ( ) || Collection . class . isAssignableFrom ( iType ) || Map . class . isAssignableFrom ( iType ) ) ; } | Checks if a class is a multi - value type . |
17,317 | public static int getSize ( final Object iObject ) { if ( iObject == null ) return 0 ; if ( ! isMultiValue ( iObject ) ) return 0 ; if ( iObject instanceof Collection < ? > ) return ( ( Collection < Object > ) iObject ) . size ( ) ; if ( iObject instanceof Map < ? , ? > ) return ( ( Map < ? , Object > ) iObject ) . siz... | Returns the size of the multi - value object |
17,318 | public static boolean pauseCurrentThread ( long iTime ) { try { if ( iTime <= 0 ) iTime = Long . MAX_VALUE ; Thread . sleep ( iTime ) ; return true ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; return false ; } } | Pauses current thread until iTime timeout or a wake up by another thread . |
17,319 | public Stream < String > containing ( double lat , double lon ) { return shapes . keySet ( ) . stream ( ) . filter ( name -> shapes . get ( name ) . contains ( lat , lon ) ) ; } | Returns the names of those shapes that contain the given lat lon . |
17,320 | public OQuery < T > setFetchPlan ( final String fetchPlan ) { OFetchHelper . checkFetchPlanValid ( fetchPlan ) ; if ( fetchPlan != null && fetchPlan . length ( ) == 0 ) this . fetchPlan = null ; else this . fetchPlan = fetchPlan ; return this ; } | Sets the fetch plan to use . |
17,321 | public static ITargetIdentifier field ( final String fieldName ) { return new ITargetIdentifier ( ) { public IDependencyInjector of ( final Object target ) { return new FieldInjector ( target , fieldName ) ; } } ; } | Returns a target identifier that uses an injector that injects directly to a member field regardless of the field s visibility . |
17,322 | public static ITargetInjector with ( final IInjectionStrategy strategy ) { return new ITargetInjector ( ) { public void bean ( Object target ) { strategy . inject ( target ) ; } } ; } | Returns an injector implementation which delegates actual injection to the given strategy when provided with a target to inject . |
17,323 | public OQueryContextNative key ( final Object iKey ) { if ( finalResult != null && finalResult . booleanValue ( ) ) return this ; if ( iKey == null ) return error ( ) ; if ( currentValue != null && currentValue instanceof Map ) currentValue = ( ( Map < Object , Object > ) currentValue ) . get ( iKey ) ; return this ; } | Sets as current value the map s value by key . |
17,324 | public synchronized RESPONSE_TYPE getValue ( final RESOURCE_TYPE iResource , final long iTimeout ) { if ( OLogManager . instance ( ) . isDebugEnabled ( ) ) OLogManager . instance ( ) . debug ( this , "Thread [" + Thread . currentThread ( ) . getId ( ) + "] is waiting for the resource " + iResource + ( iTimeout <= 0 ? "... | Wait until the requested resource is unlocked . Put the current thread in sleep until timeout or is waked up by an unlock . |
17,325 | public synchronized void setClassHandler ( final OEntityManagerClassHandler iClassHandler ) { for ( Entry < String , Class < ? > > entry : classHandler . getClassesEntrySet ( ) ) { iClassHandler . registerEntityClass ( entry . getValue ( ) ) ; } this . classHandler = iClassHandler ; } | Sets the received handler as default and merges the classes all together . |
17,326 | @ Path ( "create" ) public Response createFromRedirect ( ) { KeycloakPrincipal principal = ( KeycloakPrincipal ) sessionContext . getCallerPrincipal ( ) ; RefreshableKeycloakSecurityContext kcSecurityContext = ( RefreshableKeycloakSecurityContext ) principal . getKeycloakSecurityContext ( ) ; String refreshToken = kcSe... | This endpoint is called when Keycloak redirects the logged in user to our application . |
17,327 | @ Path ( "create" ) @ Consumes ( MediaType . APPLICATION_FORM_URLENCODED ) public Response createFromBasicAuth ( ) throws Exception { return doCreateFromBasicAuth ( null ) ; } | This endpoint is called when a client makes a REST call with basic auth as APPLICATION_FORM_URLENCODED without parameters . |
17,328 | public OStorageConfiguration load ( ) throws OSerializationException { final byte [ ] record = storage . readRecord ( CONFIG_RID , null , false , null ) . buffer ; if ( record == null ) throw new OStorageException ( "Cannot load database's configuration. The database seems to be corrupted." ) ; fromStream ( record ) ; ... | This method load the record information by the internal cluster segment . It s for compatibility with older database than 0 . 9 . 25 . |
17,329 | public static < T > Option < T > some ( T t ) { return new Option . Some < T > ( t ) ; } | Gets the some object wrapping the given value . |
17,330 | public static < T > Option < T > of ( T t ) { return t == null ? Option . < T > none ( ) : some ( t ) ; } | Wraps anything . |
17,331 | public PropertyRequest addProperty ( ElementDescriptor < ? > property ) { if ( mProp == null ) { mProp = new HashMap < ElementDescriptor < ? > , Object > ( 16 ) ; } mProp . put ( property , null ) ; return this ; } | Add another property to the list of requested properties . |
17,332 | public void setOption ( Option option ) { switch ( option ) { case ARRAY_ORDER_SIGNIFICANT : arrayComparator = new DefaultArrayNodeComparator ( ) ; break ; case ARRAY_ORDER_INSIGNIFICANT : arrayComparator = new SetArrayNodeComparator ( ) ; break ; case RETURN_PARENT_DIFFS : returnParentDiffs = true ; break ; case RETUR... | Sets an option |
17,333 | public List < JsonDelta > computeDiff ( String node1 , String node2 ) throws IOException { ObjectMapper mapper = new ObjectMapper ( ) ; return computeDiff ( mapper . readTree ( node1 ) , mapper . readTree ( node2 ) ) ; } | Computes the difference of two JSON strings and returns the differences |
17,334 | public List < JsonDelta > computeDiff ( JsonNode node1 , JsonNode node2 ) { List < JsonDelta > list = new ArrayList < > ( ) ; computeDiff ( list , new ArrayList < String > ( ) , node1 , node2 ) ; return list ; } | Computes the difference of two JSON nodes and returns the differences |
17,335 | public boolean computeDiff ( List < JsonDelta > delta , List < String > context , JsonNode node1 , JsonNode node2 ) { boolean ret = false ; if ( context . size ( ) == 0 || filter . includeField ( context ) ) { JsonComparator cmp = getComparator ( context , node1 , node2 ) ; if ( cmp != null ) { ret = cmp . compare ( de... | Returns true if there is a difference |
17,336 | public JsonComparator getComparator ( List < String > context , JsonNode node1 , JsonNode node2 ) { if ( node1 == null ) { if ( node2 == null ) { return NODIFF_CMP ; } else { return null ; } } else if ( node2 == null ) { return null ; } else { if ( node1 instanceof NullNode ) { if ( node2 instanceof NullNode ) { return... | Returns the comparator for the give field and nodes . This method can be overriden to customize comparison logic . |
17,337 | public LobbyStatus createGroupFinderLobby ( long queueId , String uuid ) { return client . sendRpcAndWait ( SERVICE , "createGroupFinderLobby" , queueId , uuid ) ; } | Create a groupfinder lobby |
17,338 | boolean flush ( ) { if ( ! dirty ) return true ; acquireExclusiveLock ( ) ; try { final long timer = OProfiler . getInstance ( ) . startChrono ( ) ; for ( int i = 0 ; i < FORCE_RETRY ; ++ i ) { try { buffer . force ( ) ; dirty = false ; break ; } catch ( Exception e ) { OLogManager . instance ( ) . debug ( this , "Cann... | Flushes the memory mapped buffer to disk only if it s dirty . |
17,339 | void close ( ) { acquireExclusiveLock ( ) ; try { if ( buffer != null ) { if ( dirty ) buffer . force ( ) ; if ( sunClass != null ) { try { final Method m = sunClass . getMethod ( "cleaner" ) ; final Object cleaner = m . invoke ( buffer ) ; cleaner . getClass ( ) . getMethod ( "clean" ) . invoke ( cleaner ) ; } catch (... | Force closing of file if it s opened yet . |
17,340 | private Set < Comparable > prepareKeys ( OIndex < ? > index , Object keys ) { final Class < ? > targetType = index . getKeyTypes ( ) [ 0 ] . getDefaultJavaType ( ) ; return convertResult ( keys , targetType ) ; } | Make type conversion of keys for specific index . |
17,341 | public void validate ( ) throws OValidationException { if ( ODatabaseRecordThreadLocal . INSTANCE . isDefined ( ) && ! getDatabase ( ) . isValidationEnabled ( ) ) return ; checkForLoading ( ) ; checkForFields ( ) ; if ( _clazz != null ) { if ( _clazz . isStrictMode ( ) ) { for ( String f : fieldNames ( ) ) { if ( _claz... | Validates the record following the declared constraints defined in schema such as mandatory notNull min max regexp etc . If the schema is not defined for the current class or there are not constraints then the validation is ignored . |
17,342 | public < T > void set ( ElementDescriptor < T > property , T value ) { if ( mSet == null ) { mSet = new HashMap < ElementDescriptor < ? > , Object > ( 16 ) ; } mSet . put ( property , value ) ; if ( mRemove != null ) { mRemove . remove ( property ) ; } } | Add a new property with a specific value to the resource . |
17,343 | public < T > void remove ( ElementDescriptor < T > property ) { if ( mRemove == null ) { mRemove = new HashMap < ElementDescriptor < ? > , Object > ( 16 ) ; } mRemove . put ( property , null ) ; if ( mSet != null ) { mSet . remove ( property ) ; } } | Remove a property from the resource . |
17,344 | public < T > void clear ( ElementDescriptor < T > property ) { if ( mRemove != null ) { mRemove . remove ( property ) ; } if ( mSet != null ) { mSet . remove ( property ) ; } } | Clear the modification of given property i . e . neither change nor remove the property . |
17,345 | public void updateRecord ( final ORecordInternal < ? > fresh ) { if ( ! isEnabled ( ) || fresh == null || fresh . isDirty ( ) || fresh . getIdentity ( ) . isNew ( ) || ! fresh . getIdentity ( ) . isValid ( ) || fresh . getIdentity ( ) . getClusterId ( ) == excludedCluster ) return ; if ( fresh . isPinned ( ) == null ||... | Push record to cache . Identifier of record used as access key |
17,346 | public ColumnList addColumn ( byte [ ] family , byte [ ] qualifier , byte [ ] value ) { columns ( ) . add ( new Column ( family , qualifier , - 1 , value ) ) ; return this ; } | Add a standard HBase column |
17,347 | public ColumnList addCounter ( byte [ ] family , byte [ ] qualifier , long incr ) { counters ( ) . add ( new Counter ( family , qualifier , incr ) ) ; return this ; } | Add an HBase counter column . |
17,348 | public Future < Map < Long , List < LeagueList > > > getLeagues ( long ... summoners ) { return new ApiFuture < > ( ( ) -> handler . getLeagues ( summoners ) ) ; } | Get a listing of leagues for the specified summoners |
17,349 | public Future < Map < Long , List < LeagueItem > > > getLeagueEntries ( long ... summoners ) { return new ApiFuture < > ( ( ) -> handler . getLeagueEntries ( summoners ) ) ; } | Get a listing of all league entries in the summoners leagues |
17,350 | public Future < List < LeagueList > > getLeagues ( String teamId ) { return new ApiFuture < > ( ( ) -> handler . getLeagues ( teamId ) ) ; } | Get a listing of leagues for the specified team |
17,351 | public Future < Map < String , List < LeagueList > > > getLeagues ( String ... teamIds ) { return new ApiFuture < > ( ( ) -> handler . getLeagues ( teamIds ) ) ; } | Get a listing of leagues for the specified teams |
17,352 | public Future < List < LeagueItem > > getLeagueEntries ( String teamId ) { return new ApiFuture < > ( ( ) -> handler . getLeagueEntries ( teamId ) ) ; } | Get a listing of all league entries in the team s leagues |
17,353 | public Future < Map < String , List < LeagueItem > > > getLeagueEntries ( String ... teamIds ) { return new ApiFuture < > ( ( ) -> handler . getLeagueEntries ( teamIds ) ) ; } | Get a listing of all league entries in the teams leagues |
17,354 | public Future < MatchDetail > getMatch ( long matchId , boolean includeTimeline ) { return new ApiFuture < > ( ( ) -> handler . getMatch ( matchId , includeTimeline ) ) ; } | Retrieves the specified match . |
17,355 | public Future < List < MatchSummary > > getMatchHistory ( long playerId , String [ ] championIds , QueueType ... queueTypes ) { return new ApiFuture < > ( ( ) -> handler . getMatchHistory ( playerId , championIds , queueTypes ) ) ; } | Retrieve a player s match history filtering out all games not in the specified queues . |
17,356 | public Future < RankedStats > getRankedStats ( long summoner , Season season ) { return new ApiFuture < > ( ( ) -> handler . getRankedStats ( summoner , season ) ) ; } | Get ranked stats for a player in a specific season |
17,357 | public Future < List < PlayerStats > > getStatsSummary ( long summoner , Season season ) { return new ApiFuture < > ( ( ) -> handler . getStatsSummary ( summoner , season ) ) ; } | Get player stats for the player |
17,358 | public Future < Map < String , Summoner > > getSummoners ( String ... names ) { return new ApiFuture < > ( ( ) -> handler . getSummoners ( names ) ) ; } | Get summoner information for the summoners with the specified names |
17,359 | public Future < Map < Integer , Summoner > > getSummoners ( Integer ... ids ) { return new ApiFuture < > ( ( ) -> handler . getSummoners ( ids ) ) ; } | Get summoner information for the summoners with the specified ids |
17,360 | public Future < Map < Integer , Set < MasteryPage > > > getMasteryPagesMultipleUsers ( Integer ... ids ) { return new ApiFuture < > ( ( ) -> handler . getMasteryPagesMultipleUsers ( ids ) ) ; } | Retrieve mastery pages for multiple users |
17,361 | public Future < Map < Integer , String > > getSummonerNames ( Integer ... ids ) { return new ApiFuture < > ( ( ) -> handler . getSummonerNames ( ids ) ) ; } | Retrieve summoner names for the specified ids |
17,362 | public Future < Map < Integer , Set < RunePage > > > getRunePagesMultipleUsers ( int ... ids ) { return new ApiFuture < > ( ( ) -> handler . getRunePagesMultipleUsers ( ids ) ) ; } | Retrieve runes pages for multiple users |
17,363 | public Future < Map < Long , List < RankedTeam > > > getTeams ( long ... ids ) { return new ApiFuture < > ( ( ) -> handler . getTeamsBySummoners ( ids ) ) ; } | Retrieve the ranked teams of the specified users |
17,364 | public Future < Map < String , RankedTeam > > getTeams ( String ... teamIds ) { return new ApiFuture < > ( ( ) -> handler . getTeams ( teamIds ) ) ; } | Retrieve information for the specified ranked teams |
17,365 | public Future < List < Long > > getSummonerIds ( String ... names ) { return new ApiFuture < > ( ( ) -> handler . getSummonerIds ( names ) ) ; } | Retrieve summoner ids for the specified names |
17,366 | public static ThrottledApiHandler developmentDefault ( Shard shard , String token ) { return new ThrottledApiHandler ( shard , token , new Limit ( 10 , 10 , TimeUnit . SECONDS ) , new Limit ( 500 , 10 , TimeUnit . MINUTES ) ) ; } | Returns a throttled api handler with the current development request limits which is 10 requests per 10 seconds and 500 requests per 10 minutes |
17,367 | public void updateRecord ( final ORecordInternal < ? > record ) { if ( isEnabled ( ) && record . getIdentity ( ) . getClusterId ( ) != excludedCluster && record . getIdentity ( ) . isValid ( ) ) { underlying . lock ( record . getIdentity ( ) ) ; try { if ( underlying . get ( record . getIdentity ( ) ) != record ) under... | Pushes record to cache . Identifier of record used as access key |
17,368 | public ORecordInternal < ? > findRecord ( final ORID rid ) { if ( ! isEnabled ( ) ) return null ; ORecordInternal < ? > record ; underlying . lock ( rid ) ; try { record = underlying . get ( rid ) ; if ( record == null ) { record = secondary . retrieveRecord ( rid ) ; if ( record != null ) underlying . put ( record ) ;... | Looks up for record in cache by it s identifier . Optionally look up in secondary cache and update primary with found record |
17,369 | @ SuppressWarnings ( "rawtypes" ) public Object execute ( final Map < Object , Object > iArgs ) { if ( indexName == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not been parsed yet" ) ; final ODatabaseRecord database = getDatabase ( ) ; final OIndex < ? > idx ; if ( fields ==... | Execute the CREATE INDEX . |
17,370 | public Team createTeam ( String name , String tag ) { return client . sendRpcAndWait ( SERVICE , "createTeam" , name , tag ) ; } | Create a new ranked team with the specified name and tag |
17,371 | public Team invitePlayer ( long summonerId , TeamId teamId ) { return client . sendRpcAndWait ( SERVICE , "invitePlayer" , summonerId , teamId ) ; } | Invite a player to the target team |
17,372 | public Team kickPlayer ( long summonerId , TeamId teamId ) { return client . sendRpcAndWait ( SERVICE , "kickPlayer" , summonerId , teamId ) ; } | Kick a player from the target team |
17,373 | static AnalysisResult analyse ( Class < ? > klass , Constructor < ? > constructor ) throws IOException { Class < ? > [ ] parameterTypes = constructor . getParameterTypes ( ) ; InputStream in = klass . getResourceAsStream ( "/" + klass . getName ( ) . replace ( '.' , '/' ) + ".class" ) ; if ( in == null ) { throw new Il... | Produces an assignment or field names to values or fails . |
17,374 | public String marshal ( ZonedDateTime zonedDateTime ) { if ( null == zonedDateTime ) { return null ; } return zonedDateTime . withZoneSameInstant ( ZoneOffset . UTC ) . format ( formatter ) ; } | When marshalling the provided zonedDateTime is normalized to UTC so that the output is consistent between dates and time zones . |
17,375 | public static boolean isValid ( String sentence ) { try { return sentence . substring ( sentence . lastIndexOf ( "*" ) + 1 ) . equalsIgnoreCase ( getChecksum ( sentence ) ) ; } catch ( AisParseException e ) { return false ; } } | Returns true if and only if the sentence s checksum matches the calculated checksum . |
17,376 | private static Properties getEnvironmentFile ( File configFile ) { Properties mergedProperties = new Properties ( ) ; InputStream inputStream ; try { inputStream = new FileInputStream ( configFile ) ; } catch ( FileNotFoundException e ) { return mergedProperties ; } try { mergedProperties . load ( inputStream ) ; input... | Leser properties fra classpath og vil overlaste i reverse order slik at classpath reverse order styrer hvilke props som gjelder . |
17,377 | private static OIndexSearchResult createIndexedProperty ( final OSQLFilterCondition iCondition , final Object iItem ) { if ( iItem == null || ! ( iItem instanceof OSQLFilterItemField ) ) return null ; if ( iCondition . getLeft ( ) instanceof OSQLFilterItemField && iCondition . getRight ( ) instanceof OSQLFilterItemFiel... | Add SQL filter field to the search candidate list . |
17,378 | void addResult ( String valueData , String detailData ) { if ( value ) { if ( valueData == null ) throw new IllegalArgumentException ( CLASS + ": valueData may not be null" ) ; values . add ( valueData ) ; if ( detail ) { if ( detailData == null ) throw new IllegalArgumentException ( CLASS + ": detailData may not be nu... | Store the data for a match found |
17,379 | public String marshal ( Object jaxbObject ) { if ( jaxbContext == null ) { logger . error ( "Trying to marshal with a null jaxbContext, returns null. Check your configuration, e.g. jaxb-transformers!" ) ; return null ; } try { StringWriter writer = new StringWriter ( ) ; Marshaller marshaller = jaxbContext . createMars... | Marshal a JAXB object to a XML - string |
17,380 | static boolean isPghp ( String line ) { if ( line == null ) return false ; else return pghpPattern . matcher ( line ) . matches ( ) ; } | Returns true if and only if the given NMEA line is a PGHP line . Remember that the line can start with a tag block . |
17,381 | public static boolean isExactEarthTimestamp ( String line ) { try { new NmeaMessageExactEarthTimestamp ( line ) ; return true ; } catch ( AisParseException e ) { return false ; } catch ( NmeaMessageParseException e ) { return false ; } } | Returns true if the given line is a custom ExactEarth timestamp . |
17,382 | private static long getTime ( int year , int month , int day , int hour , int minute , int second , int millisecond ) { Calendar cal = Calendar . getInstance ( Util . TIME_ZONE_UTC ) ; cal . set ( year , month - 1 , day , hour , minute , second ) ; cal . set ( Calendar . MILLISECOND , millisecond ) ; return cal . getTi... | Returns the epoch time in ms . |
17,383 | private String getFolderAndCreateIfMissing ( String inFolder ) { String folder = outputFolder ; if ( inFolder != null ) { folder += "/" + inFolder ; } mkdirs ( folder ) ; return folder ; } | Computes foldername and creates the folders that does not already exist |
17,384 | public static EventBus get ( ) { if ( EventBus . instance == null ) { EventBus . instance = new EventBus ( ) ; } return EventBus . instance ; } | Get the singleton . |
17,385 | public ORecordIteratorClusters < REC > last ( ) { currentClusterIdx = clusterIds . length - 1 ; current . clusterPosition = liveUpdated ? database . countClusterElements ( clusterIds [ currentClusterIdx ] ) : lastClusterPosition + 1 ; return this ; } | Move the iterator to the end of the range . If no range was specified move to the last record of the cluster . |
17,386 | private static OIdentifiable linkToStream ( final StringBuilder buffer , final ORecordSchemaAware < ? > iParentRecord , Object iLinked ) { if ( iLinked == null ) return null ; OIdentifiable resultRid = null ; ORID rid ; final ODatabaseRecord database = ODatabaseRecordThreadLocal . INSTANCE . get ( ) ; if ( iLinked inst... | Serialize the link . |
17,387 | public ODocument toStream ( ) { acquireExclusiveLock ( ) ; try { document . setInternalStatus ( ORecordElement . STATUS . UNMARSHALLING ) ; try { final ORecordTrackedSet idxs = new ORecordTrackedSet ( document ) ; for ( final OIndexInternal < ? > i : indexes . values ( ) ) { idxs . add ( i . updateConfiguration ( ) ) ;... | Binds POJO to ODocument . |
17,388 | private void releaseCallbacks ( Exception ex ) { synchronized ( callbacks ) { for ( Map . Entry < Integer , InvokeCallback > cb : callbacks . entrySet ( ) ) { cb . getValue ( ) . release ( ex ) ; } } } | Release waiting threads if we fail for some reason |
17,389 | synchronized void line ( String line , long arrivalTime ) { if ( count . incrementAndGet ( ) % logCountFrequency == 0 ) log . info ( "count=" + count . get ( ) + ",buffer size=" + lines . size ( ) ) ; NmeaMessage nmea ; try { nmea = NmeaUtil . parseNmea ( line ) ; } catch ( NmeaMessageParseException e ) { listener . in... | Handles the arrival of a new NMEA line at the given arrival time . |
17,390 | private Set < Integer > findExpiredIndexesBeforeIndex ( int index ) { long indexTime = getLineTime ( index ) ; Set < Integer > removeThese = Sets . newHashSet ( ) ; for ( int i = index - 1 ; i >= 0 ; i -- ) { if ( indexTime - getLineTime ( i ) > MAXIMUM_ARRIVAL_TIME_DIFFERENCE_MS ) { listener . timestampNotFound ( getL... | Returns the list of those indexes that can be removed from the buffer because they have a timestamp more than MAXIMUM_ARRIVAL_TIME_DIFFERENCE_MS from the arrival time of the given index . |
17,391 | private Set < Integer > matchWithClosestAisMessageIfBufferLargeEnough ( long arrivalTime , Integer earliestTimestampLineIndex ) { String timestampLine = getLine ( earliestTimestampLineIndex ) ; long time = getLineTime ( earliestTimestampLineIndex ) ; log . debug ( "ts=" + timestampLine + ",time=" + time ) ; Set < Integ... | Finds matches and reports them to the listeners if buffer has a sufficent span of time in it . Returns the indexes that should be removed from the buffer . |
17,392 | private Set < Integer > reportMatchAndFindIndexesToRemove ( Integer earliestTimestampLineIndex , NmeaMessageExactEarthTimestamp timestamp , Integer lowestTimeDiffIndex ) { String msg = getLine ( lowestTimeDiffIndex ) ; log . debug ( "found matching msg=" + msg ) ; listener . message ( msg , timestamp . getTime ( ) ) ; ... | Reports a found match and returns the indexes that can be removed from the buffer . |
17,393 | public static MimeMessage createMimeMessage ( Session session , String from , String [ ] to , String subject , String content , DataSource [ ] attachments ) { logger . debug ( "Creates a mime message with {} attachments" , ( attachments == null ) ? 0 : attachments . length ) ; try { MimeMessage message = new MimeMessag... | Creates a mime - message multipart if attachements are supplied otherwise as plain text . Assumes UTF - 8 encoding for both subject and content . |
17,394 | public static void disableTlsServerCertificateCheck ( Client client ) { if ( ! ( client . getConduit ( ) instanceof HTTPConduit ) ) { log . warn ( "Conduit not of type HTTPConduit (" + client . getConduit ( ) . getClass ( ) . getName ( ) + ") , skip disabling server certification validation." ) ; return ; } log . warn ... | Disables validation of https server certificates only to be used during development and tests!!! |
17,395 | public boolean isRuleDefined ( final String iResource ) { for ( ORole r : roles ) if ( r . hasRule ( iResource ) ) return true ; return false ; } | Checks if a rule was defined for the user . |
17,396 | public Object execute ( final Map < Object , Object > iArgs ) { if ( attribute == null ) throw new OCommandExecutionException ( "Cannot execute the command because it has not yet been parsed" ) ; final OClassImpl sourceClass = ( OClassImpl ) getDatabase ( ) . getMetadata ( ) . getSchema ( ) . getClass ( className ) ; i... | Execute the ALTER PROPERTY . |
17,397 | public void flush ( ) { lock . writeLock ( ) . lock ( ) ; try { OMMapBufferEntry entry ; for ( Iterator < OMMapBufferEntry > it = bufferPoolLRU . iterator ( ) ; it . hasNext ( ) ; ) { entry = it . next ( ) ; if ( entry . file != null && entry . file . isClosed ( ) ) { if ( removeEntry ( entry ) ) it . remove ( ) ; } } ... | Flushes away all the buffers of closed files . This frees the memory . |
17,398 | public void flushFile ( final OFileMMap iFile ) { lock . readLock ( ) . lock ( ) ; try { final List < OMMapBufferEntry > entries = bufferPoolPerFile . get ( iFile ) ; if ( entries != null ) for ( OMMapBufferEntry entry : entries ) entry . flush ( ) ; } finally { lock . readLock ( ) . unlock ( ) ; } } | Flushes all the buffers of the passed file . |
17,399 | private static int searchEntry ( final List < OMMapBufferEntry > fileEntries , final long iBeginOffset , final int iSize ) { if ( fileEntries == null || fileEntries . size ( ) == 0 ) return - 1 ; int high = fileEntries . size ( ) - 1 ; if ( high < 0 ) return - 1 ; int low = 0 ; int mid = - 1 ; OMMapBufferEntry e ; whil... | Search for a buffer in the ordered list . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.