idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
1,800 | public CoverageDataResults getValuesUnbounded ( BoundingBox requestBoundingBox ) { CoverageDataRequest request = new CoverageDataRequest ( requestBoundingBox ) ; return getValuesUnbounded ( request ) ; } | Get the unbounded coverage data values within the bounding box . Unbounded results retrieves and returns each coverage data pixel . The results size equals the width and height of all matching pixels . |
1,801 | protected Double getBilinearInterpolationValue ( GriddedTile griddedTile , TImage image , Double [ ] [ ] leftLastColumns , Double [ ] [ ] topLeftRows , Double [ ] [ ] topRows , int y , int x , float widthRatio , float heightRatio , float destTop , float destLeft , float srcTop , float srcLeft ) { float xSource = getXSo... | Get the bilinear interpolation coverage data value |
1,802 | protected Double getNearestNeighborValue ( GriddedTile griddedTile , TImage image , Double [ ] [ ] leftLastColumns , Double [ ] [ ] topLeftRows , Double [ ] [ ] topRows , int y , int x , float widthRatio , float heightRatio , float destTop , float destLeft , float srcTop , float srcLeft ) { float xSource = getXSource (... | Get the nearest neighbor coverage data value |
1,803 | private Double getValueOverBorders ( GriddedTile griddedTile , TImage image , Double [ ] [ ] leftLastColumns , Double [ ] [ ] topLeftRows , Double [ ] [ ] topRows , int x , int y ) { Double value = null ; if ( x < image . getWidth ( ) && y < image . getHeight ( ) ) { if ( x >= 0 && y >= 0 ) { value = getValue ( gridded... | Get the coverage data value from the coordinate location . If the coordinate crosses the left top or top left tile attempts to get the coverage data value from previously processed border coverage data values . |
1,804 | public boolean topicExists ( String topicName ) { Map < String , List < PartitionInfo > > topicInfo = getTopicInfo ( ) ; return topicInfo != null && topicInfo . containsKey ( topicName ) ; } | Checks if a Kafka topic exists . |
1,805 | public List < PartitionInfo > getPartitionInfo ( String topicName ) { Map < String , List < PartitionInfo > > topicInfo = getTopicInfo ( ) ; List < PartitionInfo > partitionInfo = topicInfo != null ? topicInfo . get ( topicName ) : null ; return partitionInfo != null ? Collections . unmodifiableList ( partitionInfo ) :... | Gets partition information of a topic . |
1,806 | @ SuppressWarnings ( "unchecked" ) public Set < String > getTopics ( ) { Map < String , List < PartitionInfo > > topicInfo = getTopicInfo ( ) ; Set < String > topics = topicInfo != null ? topicInfo . keySet ( ) : null ; return topics != null ? Collections . unmodifiableSet ( topics ) : Collections . EMPTY_SET ; } | Gets all available topics . |
1,807 | private KafkaConsumer < String , byte [ ] > _getConsumer ( String topic , boolean autoCommitOffsets ) { KafkaConsumer < String , byte [ ] > consumer = topicConsumers . get ( topic ) ; if ( consumer == null ) { consumer = KafkaHelper . createKafkaConsumer ( bootstrapServers , consumerGroupId , consumeFromBeginning , aut... | Prepares a consumer to consume messages from a Kafka topic . |
1,808 | private BlockingQueue < ConsumerRecord < String , byte [ ] > > _getBuffer ( String topic ) { BlockingQueue < ConsumerRecord < String , byte [ ] > > buffer = topicBuffers . get ( topic ) ; if ( buffer == null ) { buffer = new LinkedBlockingQueue < ConsumerRecord < String , byte [ ] > > ( ) ; BlockingQueue < ConsumerReco... | Gets a buffer to store consumed messages from a Kafka topic . |
1,809 | private KafkaMsgConsumerWorker _getWorker ( String topic , boolean autoCommitOffsets ) { KafkaMsgConsumerWorker worker = topicWorkers . get ( topic ) ; if ( worker == null ) { Collection < IKafkaMessageListener > msgListeners = topicMsgListeners . get ( topic ) ; worker = new KafkaMsgConsumerWorker ( this , topic , msg... | Prepares a worker to consume messages from a Kafka topic . |
1,810 | public boolean addMessageListener ( String topic , IKafkaMessageListener messageListener , boolean autoCommitOffsets ) { synchronized ( topicMsgListeners ) { if ( topicMsgListeners . put ( topic , messageListener ) ) { _getWorker ( topic , autoCommitOffsets ) ; return true ; } } return false ; } | Adds a message listener to a topic . |
1,811 | private void _fetch ( BlockingQueue < ConsumerRecord < String , byte [ ] > > buffer , String topic , long waitTime , TimeUnit waitTimeUnit ) { KafkaConsumer < String , byte [ ] > consumer = _getConsumer ( topic ) ; synchronized ( consumer ) { _checkAndSubscribe ( consumer , topic ) ; Set < String > subscription = consu... | Fetches messages from Kafka and puts into buffer . |
1,812 | public static boolean seekToBeginning ( KafkaConsumer < ? , ? > consumer , String topic ) { boolean result = false ; synchronized ( consumer ) { Set < TopicPartition > topicParts = consumer . assignment ( ) ; if ( topicParts != null ) { for ( TopicPartition tp : topicParts ) { if ( StringUtils . equals ( topic , tp . t... | Seeks the consumer s cursor to the beginning of a topic . |
1,813 | public static Properties buildKafkaProducerProps ( ProducerType type , String bootstrapServers ) { return buildKafkaProducerProps ( type , bootstrapServers , null ) ; } | Builds default producer s properties . |
1,814 | public static Properties buildKafkaConsumerProps ( String bootstrapServers , String consumerGroupId , boolean consumeFromBeginning , boolean autoCommitOffsets ) { return buildKafkaConsumerProps ( bootstrapServers , consumerGroupId , consumeFromBeginning , autoCommitOffsets , null ) ; } | Builds default consumer s properties . |
1,815 | private Document loadDocument ( String file ) { Document doc = null ; URL url = null ; File f = new File ( file ) ; if ( f . exists ( ) ) { try { url = f . toURI ( ) . toURL ( ) ; } catch ( MalformedURLException e ) { throw new ConfigurationException ( "Unable to load " + file , e ) ; } } if ( url == null ) { url = Cla... | Load the XML configuration on memory as a DOM structure with SAX . Additional information about elements location is added . Non valid DTDs or XML structures are detected . |
1,816 | public void initIvy ( ) throws ParseException , IOException , ConfigurationException { if ( ivy == null ) { IvySettings ivySettings = new IvySettings ( ) ; File settingsFile = new File ( IVY_SETTINGS_FILE ) ; if ( settingsFile . exists ( ) ) { ivySettings . load ( settingsFile ) ; } else { URL settingsURL = ClassLoader... | Ivy configuration initialization |
1,817 | private ConfigurationProvider locateConfigurationProvider ( ) { if ( configurationProvider == null ) return new IvyConfigurationProvider ( options . isOffline ( ) , options . isVerbose ( ) ) ; else return configurationProvider ; } | Takes care of chosing the proper configuration provider |
1,818 | public List < File > patch ( String ... chains ) throws InvalidConfigurationException { final List < File > result = new LinkedList < File > ( ) ; run ( result , new WalkmodCommand ( ) { public void execute ( Options options , File executionDir , String ... chains ) throws Exception { WalkModFacade facade = new WalkMod... | Generates a list of patches according the transformation chains |
1,819 | public void init ( ) throws Exception { userDir = new File ( System . getProperty ( "user.dir" ) ) . getAbsolutePath ( ) ; System . setProperty ( "user.dir" , options . getExecutionDirectory ( ) . getAbsolutePath ( ) ) ; if ( ! cfg . exists ( ) ) { ConfigurationManager manager = new ConfigurationManager ( cfg , false ,... | Initializes an empty walkmod configuration file |
1,820 | public void addChainConfig ( ChainConfig chainCfg , boolean recursive , String before ) throws Exception { long startTime = System . currentTimeMillis ( ) ; Exception exception = null ; if ( ! cfg . exists ( ) ) { init ( ) ; } userDir = new File ( System . getProperty ( "user.dir" ) ) . getAbsolutePath ( ) ; System . s... | Adds a new chain configuration into the configuration file |
1,821 | public void addTransformationConfig ( String chain , String path , boolean recursive , TransformationConfig transformationCfg , Integer order , String before ) throws Exception { long startTime = System . currentTimeMillis ( ) ; Exception exception = null ; if ( ! cfg . exists ( ) ) { init ( ) ; } userDir = new File ( ... | Adds a new transformation configuration into the configuration file |
1,822 | public void setReader ( String chain , String type , String path , boolean recursive , Map < String , String > params ) throws Exception { if ( ( type != null && ! "" . equals ( type . trim ( ) ) ) || ( path != null && ! "" . equals ( path . trim ( ) ) ) ) { long startTime = System . currentTimeMillis ( ) ; Exception e... | Sets an specific reader for an specific chain . |
1,823 | public void removePluginConfig ( PluginConfig pluginConfig , boolean recursive ) throws Exception { long startTime = System . currentTimeMillis ( ) ; Exception exception = null ; if ( ! cfg . exists ( ) ) { init ( ) ; } userDir = new File ( System . getProperty ( "user.dir" ) ) . getAbsolutePath ( ) ; System . setPrope... | Removes a plugin from the configuration file . |
1,824 | public void removeModules ( List < String > modules ) throws Exception { long startTime = System . currentTimeMillis ( ) ; Exception exception = null ; if ( ! cfg . exists ( ) ) { init ( ) ; } userDir = new File ( System . getProperty ( "user.dir" ) ) . getAbsolutePath ( ) ; System . setProperty ( "user.dir" , options ... | Removes the module list from the configuration file |
1,825 | public Configuration getConfiguration ( ) throws Exception { Configuration result = null ; if ( cfg . exists ( ) ) { userDir = new File ( System . getProperty ( "user.dir" ) ) . getAbsolutePath ( ) ; System . setProperty ( "user.dir" , options . getExecutionDirectory ( ) . getAbsolutePath ( ) ) ; try { ConfigurationMan... | Returns the equivalent configuration representation of the Walkmod config file . |
1,826 | public void removeChains ( List < String > chains , boolean recursive ) throws Exception { long startTime = System . currentTimeMillis ( ) ; Exception exception = null ; if ( cfg . exists ( ) ) { userDir = new File ( System . getProperty ( "user.dir" ) ) . getAbsolutePath ( ) ; System . setProperty ( "user.dir" , optio... | Removes the chains from the Walkmod config file . |
1,827 | public List < BeanDefinition > inspectPlugin ( PluginConfig plugin ) { Configuration conf = new ConfigurationImpl ( ) ; Collection < PluginConfig > plugins = new LinkedList < PluginConfig > ( ) ; plugins . add ( plugin ) ; conf . setPlugins ( plugins ) ; ConfigurationManager manager = new ConfigurationManager ( conf , ... | Retrieves the bean definitions that contains an specific plugin . |
1,828 | public void addConfigurationParameter ( String param , String value , String type , String category , String name , String chain , boolean recursive ) throws Exception { long startTime = System . currentTimeMillis ( ) ; Exception exception = null ; if ( cfg . exists ( ) ) { userDir = new File ( System . getProperty ( "... | Sets an specific parameter value into a bean . |
1,829 | public void addIncludesToChain ( String chain , List < String > includes , boolean recursive , boolean setToReader , boolean setToWriter ) { long startTime = System . currentTimeMillis ( ) ; Exception exception = null ; if ( cfg . exists ( ) ) { userDir = new File ( System . getProperty ( "user.dir" ) ) . getAbsolutePa... | Adds a list of includes rules into a chain |
1,830 | public static URL getResource ( String resourceName , Class < ? > callingClass ) { URL url = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( resourceName ) ; if ( url == null ) { url = ClassLoaderUtil . class . getClassLoader ( ) . getResource ( resourceName ) ; } if ( url == null ) { ClassLoader... | Load a given resource . |
1,831 | public static Attributes addLocationAttributes ( Locator locator , Attributes attrs ) { if ( locator == null || attrs . getIndex ( URI , SRC_ATTR ) != - 1 ) { return attrs ; } AttributesImpl newAttrs = attrs instanceof AttributesImpl ? ( AttributesImpl ) attrs : new AttributesImpl ( attrs ) ; return newAttrs ; } | Add location attributes to a set of SAX attributes . |
1,832 | public static void remove ( Element elem , boolean recurse ) { elem . removeAttributeNS ( URI , SRC_ATTR ) ; elem . removeAttributeNS ( URI , LINE_ATTR ) ; elem . removeAttributeNS ( URI , COL_ATTR ) ; if ( recurse ) { NodeList children = elem . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ... | Remove the location attributes from a DOM element . |
1,833 | public KafkaClient setProducerProperties ( Properties props ) { if ( props == null ) { producerProperties = null ; } else { producerProperties = new Properties ( ) ; producerProperties . putAll ( props ) ; } return this ; } | Sets custom producer configuration properties . |
1,834 | public boolean addMessageListener ( String consumerGroupId , boolean consumeFromBeginning , String topic , IKafkaMessageListener messageListener ) { KafkaMsgConsumer kafkaConsumer = getKafkaConsumer ( consumerGroupId , consumeFromBeginning ) ; return kafkaConsumer . addMessageListener ( topic , messageListener ) ; } | Adds a message listener for a topic . |
1,835 | public void flush ( ) { for ( ProducerType type : ProducerType . ALL_TYPES ) { KafkaProducer < String , byte [ ] > producer = getJavaProducer ( type ) ; if ( producer != null ) { producer . flush ( ) ; } } } | Flushes any messages in producer queue . |
1,836 | public OptionsBuilder path ( String path ) { options . put ( Options . CHAIN_PATH , path != null ? path : DEFAULT_PATH ) ; return this ; } | Sets the path option . Null value resets to default value . |
1,837 | public OptionsBuilder dynamicArgs ( Map < String , ? > dynamicArgs ) { final Map < String , Object > m = dynamicArgs != null ? Collections . unmodifiableMap ( new HashMap < String , Object > ( dynamicArgs ) ) : Collections . < String , Object > emptyMap ( ) ; options . put ( Options . DYNAMIC_ARGS , m ) ; return this ;... | Seths the dynamic arguments |
1,838 | public OptionsBuilder executionDirectory ( File executionDirectory ) { options . put ( Options . EXECUTION_DIRECTORY , executionDirectory != null ? executionDirectory : defaultExecutionDirectory ( ) ) ; return this ; } | Sets the execution directory |
1,839 | public OptionsBuilder configurationFile ( String configFile ) { if ( configFile != null ) { options . put ( Options . CONFIGURATION_FILE , new File ( configFile ) ) ; } else { options . remove ( Options . CONFIGURATION_FILE ) ; } return this ; } | Sets the walkmod configuration file . |
1,840 | private void injectServletCallback ( String method ) { Label tryStart = new Label ( ) ; Label tryEnd = new Label ( ) ; Label catchStart = new Label ( ) ; Label catchEnd = new Label ( ) ; visitTryCatchBlock ( tryStart , tryEnd , catchStart , "java/lang/NoClassDefFoundError" ) ; mark ( tryStart ) ; loadArgs ( ) ; invokeS... | Inject a callback to our servlet handler . |
1,841 | public static double getTotalGCPercentage ( ) { long totalCollectionTime = getTotalCollectionTime ( ) ; if ( totalCollectionTime == - 1 ) { return - 1.0 ; } long uptime = ManagementFactory . getRuntimeMXBean ( ) . getUptime ( ) ; return ( ( double ) totalCollectionTime / ( double ) uptime ) ; } | Returns the time spent in GC as a proportion of the time elapsed since the JVM was started . If no data is available returns - 1 . |
1,842 | public static void premain ( String agentArgs , Instrumentation inst ) { try { String bootDelegation = System . getProperty ( OSGI_BOOTDELEGATION_PROPERTY , "" ) ; if ( ! bootDelegation . equals ( "" ) ) { bootDelegation += "," ; } bootDelegation += BOOTDELEGATION_PACKAGES ; System . setProperty ( OSGI_BOOTDELEGATION_P... | Entry point for the agent via - javaagent command line parameter |
1,843 | private void visitHttp ( int version , int access , String name , String signature , String superName , String [ ] interfaces ) { if ( interfaces != null ) { for ( String iface : interfaces ) { if ( HTTP_JSP_INTERFACE . equals ( iface ) ) { jspImplementers . add ( name ) ; httpInstrumentJsp = true ; if ( Agent . debug ... | Check if HTTP request instrumentation is required |
1,844 | private MethodVisitor visitHttpMethod ( MethodVisitor mv , int access , String name , String desc , String signature , String [ ] exceptions ) { MethodVisitor httpMv = mv ; if ( ( httpInstrumentJsp && name . equals ( "_jspService" ) ) || ( httpInstrumentServlet && ( name . equals ( "doGet" ) || name . equals ( "doPost"... | Instrument HTTP request methods |
1,845 | protected void injectMethodTimer ( ) { methodEntertime = newLocal ( Type . LONG_TYPE ) ; invokeStatic ( Type . getType ( System . class ) , Method . getMethod ( CURRENT_TIME_MILLIS_METHODNAME ) ) ; storeLocal ( methodEntertime ) ; if ( Agent . debug ) { getStatic ( Type . getType ( System . class ) , "err" , Type . get... | Inject a local variable containing timestamp at method entry |
1,846 | public void setSupplementaryDataValue ( String name , String value ) { supplementaryData . put ( name , value ) ; } | Setter for supplementary data value . |
1,847 | public boolean isHashValid ( String secret ) { String generatedHash = generateHash ( secret ) ; return generatedHash . equals ( this . hash ) ; } | Helper method to determine if the HPP response security hash is valid . |
1,848 | public static void validate ( HppRequest hppRequest ) { Set < ConstraintViolation < HppRequest > > constraintViolations = validator . validate ( hppRequest ) ; if ( constraintViolations . size ( ) > 0 ) { List < String > validationMessages = new ArrayList < String > ( ) ; Iterator < ConstraintViolation < HppRequest > >... | Method validates HPP request object using JSR - 303 bean validation . |
1,849 | public static void validate ( HppResponse hppResponse , String secret ) { if ( ! hppResponse . isHashValid ( secret ) ) { LOGGER . error ( "HppResponse contains an invalid security hash." ) ; throw new RealexValidationException ( "HppResponse contains an invalid security hash" ) ; } } | Method validates HPP response hash . |
1,850 | public HppRequest addAutoSettleFlag ( boolean autoSettleFlag ) { this . autoSettleFlag = autoSettleFlag ? Flag . TRUE . getFlag ( ) : Flag . FALSE . getFlag ( ) ; return this ; } | Helper method to add autop settle flag . |
1,851 | public HppRequest addReturnTss ( boolean returnTss ) { this . returnTss = returnTss ? Flag . TRUE . getFlag ( ) : Flag . FALSE . getFlag ( ) ; return this ; } | Helper method to add return TSS . |
1,852 | public HppRequest addCardStorageEnable ( boolean cardStorageEnable ) { this . cardStorageEnable = cardStorageEnable ? Flag . TRUE . getFlag ( ) : Flag . FALSE . getFlag ( ) ; return this ; } | Helper method to add card storage enable flag . |
1,853 | public HppRequest addOfferSaveCard ( boolean offerSaveCard ) { this . offerSaveCard = offerSaveCard ? Flag . TRUE . getFlag ( ) : Flag . FALSE . getFlag ( ) ; return this ; } | Helper method to add offer to save card . |
1,854 | public HppRequest addPayerExists ( boolean payerExists ) { this . payerExists = payerExists ? Flag . TRUE . getFlag ( ) : Flag . FALSE . getFlag ( ) ; return this ; } | Helper method to add payer exists flag . |
1,855 | public HppRequest addSupplementaryDataValue ( String name , String value ) { supplementaryData . put ( name , value ) ; return this ; } | Helper method to add supplementary data . |
1,856 | public HppRequest addValidateCardOnly ( boolean validateCardOnly ) { this . validateCardOnly = validateCardOnly ? Flag . TRUE . getFlag ( ) : Flag . FALSE . getFlag ( ) ; return this ; } | Helper method to add validate card only flag . |
1,857 | public HppRequest addDccEnable ( boolean dccEnable ) { this . dccEnable = dccEnable ? Flag . TRUE . getFlag ( ) : Flag . FALSE . getFlag ( ) ; return this ; } | Helper method to add DCC enable flag . |
1,858 | public HppRequest generateDefaults ( String secret ) { if ( null == this . timeStamp || "" . equals ( this . timeStamp ) ) { this . timeStamp = GenerationUtils . generateTimestamp ( ) ; } if ( null == this . orderId || "" . equals ( this . orderId ) ) { this . orderId = GenerationUtils . generateOrderId ( ) ; } hash ( ... | Generates default values for fields such as hash timestamp and order ID . |
1,859 | public ServerFilter groups ( Group ... groups ) { allItemsNotNull ( groups , "Groups" ) ; groupFilter = groupFilter . and ( Filter . or ( map ( groups , Group :: asFilter ) ) ) ; return this ; } | Method allow to restrict searched servers by groups |
1,860 | public ServerFilter where ( Predicate < ServerMetadata > filter ) { checkNotNull ( filter , "Filter must be not a null" ) ; predicate = predicate . and ( filter ) ; return this ; } | Method allow to specify custom search servers predicate |
1,861 | public ServerFilter nameContains ( String ... subStrings ) { allItemsNotNull ( subStrings , "Name keywords" ) ; predicate = predicate . and ( combine ( ServerMetadata :: getName , in ( asList ( subStrings ) , Predicates :: containsIgnoreCase ) ) ) ; return this ; } | Method allow to restrict servers by keywords that contains in target server name . Matching is case insensitive . Comparison use search substring algorithms . |
1,862 | public ServerFilter descriptionContains ( String ... subStrings ) { allItemsNotNull ( subStrings , "Description keywords" ) ; predicate = predicate . and ( combine ( ServerMetadata :: getDescription , in ( asList ( subStrings ) , Predicates :: containsIgnoreCase ) ) ) ; return this ; } | Method allow to find server that description contains one of specified keywords . Matching is case insensitive . |
1,863 | public ServerFilter powerStates ( PowerState ... states ) { allItemsNotNull ( states , "Power states" ) ; predicate = predicate . and ( combine ( s -> s . getDetails ( ) . getPowerState ( ) , in ( map ( states , PowerState :: getCode ) ) ) ) ; return this ; } | Method allow to find servers with specified power state of target servers |
1,864 | public NetworkFilter nameContains ( String ... subStrings ) { checkNotNull ( subStrings , "Name match criteria must be not a null" ) ; predicate = predicate . and ( combine ( NetworkMetadata :: getName , in ( asList ( subStrings ) , Predicates :: containsIgnoreCase ) ) ) ; return this ; } | Method allow to filter networks by key phrase that contains in its name . Filtering will be case insensitive and will use substring matching . |
1,865 | public NetworkFilter names ( String ... names ) { checkNotNull ( names , "Name match criteria must be not a null" ) ; predicate = predicate . and ( combine ( NetworkMetadata :: getName , in ( asList ( names ) , Predicates :: containsIgnoreCase ) ) ) ; return this ; } | Method allow to filter networks by names . Filtering will be case insensitive and will use string equality comparison . |
1,866 | public NetworkFilter where ( Predicate < NetworkMetadata > filter ) { checkNotNull ( filter , "Filter predicate must be not a null" ) ; this . predicate = this . predicate . and ( filter ) ; return this ; } | Method allow to filter networks using predicate . |
1,867 | public GroupFilter dataCentersWhere ( Predicate < DataCenterMetadata > predicate ) { dataCenterFilter . where ( dataCenterFilter . getPredicate ( ) . or ( predicate ) ) ; return this ; } | Method allow to provide filtering predicate that restrict group by data centers that contains its . |
1,868 | public GroupFilter nameContains ( String ... subStrings ) { checkNotNull ( subStrings , "Name match criteria must be not a null" ) ; predicate = predicate . and ( combine ( GroupMetadata :: getName , in ( asList ( subStrings ) , Predicates :: containsIgnoreCase ) ) ) ; return this ; } | Method allow to filter groups by key phrase that contains in its name . Filtering will be case insensitive and will use substring matching . |
1,869 | public GroupFilter names ( String ... names ) { checkNotNull ( names , "Name match criteria must be not a null" ) ; predicate = predicate . and ( combine ( GroupMetadata :: getName , in ( asList ( names ) , Predicates :: containsIgnoreCase ) ) ) ; return this ; } | Method allow to filter groups by names . Filtering will be case insensitive and will use string equality comparison . |
1,870 | public GroupFilter where ( Predicate < GroupMetadata > filter ) { checkNotNull ( filter , "Filter predicate must be not a null" ) ; this . predicate = this . predicate . and ( filter ) ; return this ; } | Method allow to filter groups using predicate . |
1,871 | public AutoscalePolicyFilter nameContains ( String ... names ) { allItemsNotNull ( names , "Autoscale policy names" ) ; predicate = predicate . and ( combine ( AutoscalePolicyMetadata :: getName , in ( asList ( names ) , Predicates :: containsIgnoreCase ) ) ) ; return this ; } | Method allow to find autoscale policies that contains some substring in name . Filtering is case insensitive . |
1,872 | public AutoscalePolicyFilter names ( String ... names ) { allItemsNotNull ( names , "Autoscale policies names" ) ; predicate = predicate . and ( combine ( AutoscalePolicyMetadata :: getName , in ( names ) ) ) ; return this ; } | Method allow to find autoscale policies by its names Filtering is case sensitive . |
1,873 | public String getCidr ( ) { if ( cidr != null ) { return cidr ; } if ( ipAddress != null ) { if ( mask != null ) { return new SubnetUtils ( ipAddress , mask ) . getCidrSignature ( ) ; } if ( cidrMask != null ) { return new SubnetUtils ( ipAddress + cidrMask ) . getCidrSignature ( ) ; } } return null ; } | Returns IP address in CIDR format . |
1,874 | @ Test ( groups = { SAMPLES } ) public void getBillingStatisticsByAllDatacenters ( ) { Statistics summarize = statisticsService . billingStats ( ) . forDataCenters ( new DataCenterFilter ( ) . dataCenters ( DE_FRANKFURT , US_EAST_STERLING ) ) . summarize ( ) ; assertNotNull ( summarize ) ; } | Step 1 . App query total billing statistics by all datacenters |
1,875 | @ Test ( groups = { SAMPLES } ) public void getBillingStatisticsGroupedByDatacenters ( ) { List < BillingStatsEntry > stats = statisticsService . billingStats ( ) . forGroups ( new GroupFilter ( ) . nameContains ( nameCriteria ) ) . groupByDataCenter ( ) ; assertNotNull ( stats ) ; } | Step 2 . App query billing statistics grouped by datacenters |
1,876 | @ Test ( groups = { SAMPLES } ) public void getDE1BillingStatsGroupedByServers ( ) { List < BillingStatsEntry > stats = statisticsService . billingStats ( ) . forDataCenters ( new DataCenterFilter ( ) . dataCenters ( DE_FRANKFURT ) ) . groupByServer ( ) ; assertNotNull ( stats ) ; } | Step 3 . App query billing statistics grouped by servers within DE1 Datacenter |
1,877 | @ Test ( groups = { SAMPLES } ) public void getMonitoringStatisticsByAllDatacenters ( ) { List < MonitoringStatsEntry > summarize = statisticsService . monitoringStats ( ) . forDataCenters ( new DataCenterFilter ( ) . dataCenters ( DE_FRANKFURT , US_EAST_STERLING ) ) . forTime ( new ServerMonitoringFilter ( ) . last ( ... | Step 4 . App query total monitoring statistics by all datacenters |
1,878 | @ Test ( groups = { SAMPLES } ) public void getMonitoringStatisticsGroupedByDatacenters ( ) { List < MonitoringStatsEntry > stats = statisticsService . monitoringStats ( ) . forGroups ( new GroupFilter ( ) . nameContains ( nameCriteria ) ) . forTime ( new ServerMonitoringFilter ( ) . last ( Duration . ofDays ( 2 ) ) ) ... | Step 5 . App query monitoring statistics grouped by datacenters |
1,879 | @ Test ( groups = { SAMPLES } ) public void getDE1MonitoringStatsGroupedByServers ( ) { List < MonitoringStatsEntry > stats = statisticsService . monitoringStats ( ) . forDataCenters ( new DataCenterFilter ( ) . dataCenters ( DE_FRANKFURT ) ) . forTime ( new ServerMonitoringFilter ( ) . last ( Duration . ofDays ( 2 ) )... | Step 6 . App query monitoring statistics grouped by servers within DE1 Datacenter |
1,880 | @ Test ( groups = { SAMPLES } ) public void getDE1MonitoringStatsForLastHourGroupedByServers ( ) { List < MonitoringStatsEntry > stats = statisticsService . monitoringStats ( ) . forDataCenters ( new DataCenterFilter ( ) . dataCenters ( DE_FRANKFURT ) ) . forTime ( new ServerMonitoringFilter ( ) . last ( Duration . ofH... | Step 7 . App query monitoring statistics for last hour grouped by DataCenter |
1,881 | @ Test ( groups = { SAMPLES } ) public void getInvoiceDataForPreviousMonth ( ) { InvoiceData invoice = invoiceService . getInvoice ( LocalDate . now ( ) . minusMonths ( 1 ) ) ; assertNotNull ( invoice ) ; } | Step 8 . App query invoice statistics for previous month |
1,882 | @ Test ( groups = { SAMPLES } ) public void getInvoiceDataForStartOf2015 ( ) { InvoiceData invoice = invoiceService . getInvoice ( 2015 , 1 ) ; assertNotNull ( invoice ) ; } | Step 8 . App query invoice statistics for Jan - 15 |
1,883 | public OperationFuture < LoadBalancer > create ( LoadBalancerConfig config ) { String dataCenterId = dataCenterService . findByRef ( config . getDataCenter ( ) ) . getId ( ) ; LoadBalancerMetadata loadBalancer = loadBalancerClient . create ( dataCenterId , new LoadBalancerRequest ( ) . name ( config . getName ( ) ) . d... | Create load balancer |
1,884 | public OperationFuture < LoadBalancer > update ( LoadBalancer loadBalancer , LoadBalancerConfig config ) { LoadBalancerMetadata loadBalancerMetadata = findByRef ( loadBalancer ) ; loadBalancerClient . update ( loadBalancerMetadata . getDataCenterId ( ) , loadBalancerMetadata . getId ( ) , new LoadBalancerRequest ( ) . ... | Update load balancer |
1,885 | public OperationFuture < List < LoadBalancer > > update ( List < LoadBalancer > loadBalancerList , LoadBalancerConfig config ) { loadBalancerList . forEach ( loadBalancer -> update ( loadBalancer , config ) ) ; return new OperationFuture < > ( loadBalancerList , new NoWaitingJobFuture ( ) ) ; } | Update load balancer list |
1,886 | public OperationFuture < List < LoadBalancer > > update ( LoadBalancerFilter loadBalancerFilter , LoadBalancerConfig config ) { checkNotNull ( loadBalancerFilter , "Load balancer filter must be not null" ) ; List < LoadBalancer > loadBalancerList = findLazy ( loadBalancerFilter ) . map ( metadata -> LoadBalancer . refB... | Update filtered load balancers |
1,887 | public OperationFuture < LoadBalancer > delete ( LoadBalancer loadBalancer ) { LoadBalancerMetadata loadBalancerMetadata = findByRef ( loadBalancer ) ; loadBalancerClient . delete ( loadBalancerMetadata . getDataCenterId ( ) , loadBalancerMetadata . getId ( ) ) ; return new OperationFuture < > ( loadBalancer , new NoWa... | Delete load balancer |
1,888 | public OperationFuture < List < LoadBalancer > > delete ( LoadBalancer ... loadBalancer ) { return delete ( Arrays . asList ( loadBalancer ) ) ; } | Delete array of load balancers |
1,889 | public OperationFuture < List < LoadBalancer > > delete ( LoadBalancerFilter filter ) { List < LoadBalancer > loadBalancerList = findLazy ( filter ) . map ( metadata -> LoadBalancer . refById ( metadata . getId ( ) , DataCenter . refById ( metadata . getDataCenterId ( ) ) ) ) . collect ( toList ( ) ) ; return delete ( ... | Delete filtered load balancers |
1,890 | public OperationFuture < List < LoadBalancer > > delete ( List < LoadBalancer > loadBalancerList ) { List < JobFuture > jobs = loadBalancerList . stream ( ) . map ( reference -> delete ( reference ) . jobFuture ( ) ) . collect ( toList ( ) ) ; return new OperationFuture < > ( loadBalancerList , new ParallelJobsFuture (... | Delete load balancer list |
1,891 | public OperationFuture < FirewallPolicy > create ( FirewallPolicyConfig config ) { String dataCenterId = dataCenterService . findByRef ( config . getDataCenter ( ) ) . getId ( ) ; FirewallPolicyMetadata firewall = firewallPolicyClient . create ( dataCenterId , composeFirewallPolicyRequest ( config ) ) ; return new Oper... | Create firewall policy |
1,892 | public OperationFuture < FirewallPolicy > update ( FirewallPolicy firewallPolicy , FirewallPolicyConfig config ) { FirewallPolicyMetadata metadata = findByRef ( firewallPolicy ) ; firewallPolicyClient . update ( metadata . getDataCenterId ( ) , metadata . getId ( ) , composeFirewallPolicyRequest ( config ) ) ; return n... | Update firewall policy |
1,893 | public OperationFuture < List < FirewallPolicy > > update ( List < FirewallPolicy > firewallPolicyList , FirewallPolicyConfig config ) { firewallPolicyList . forEach ( firewallPolicy -> update ( firewallPolicy , config ) ) ; return new OperationFuture < > ( firewallPolicyList , new NoWaitingJobFuture ( ) ) ; } | Update firewall policy list |
1,894 | public OperationFuture < List < FirewallPolicy > > update ( FirewallPolicyFilter firewallPolicyFilter , FirewallPolicyConfig config ) { checkNotNull ( firewallPolicyFilter , "Firewall policy filter must be not null" ) ; List < FirewallPolicy > firewallPolicyList = findLazy ( firewallPolicyFilter ) . map ( metadata -> F... | Update filtered firewall policies |
1,895 | public OperationFuture < FirewallPolicy > delete ( FirewallPolicy firewallPolicy ) { FirewallPolicyMetadata metadata = findByRef ( firewallPolicy ) ; firewallPolicyClient . delete ( metadata . getDataCenterId ( ) , metadata . getId ( ) ) ; return new OperationFuture < > ( firewallPolicy , new NoWaitingJobFuture ( ) ) ;... | Delete firewall policy |
1,896 | public OperationFuture < List < FirewallPolicy > > delete ( FirewallPolicy ... firewallPolicies ) { return delete ( Arrays . asList ( firewallPolicies ) ) ; } | Delete array of firewall policy |
1,897 | public OperationFuture < List < FirewallPolicy > > delete ( FirewallPolicyFilter filter ) { return delete ( findLazy ( filter ) . map ( metadata -> FirewallPolicy . refById ( metadata . getId ( ) , DataCenter . refById ( metadata . getDataCenterId ( ) ) ) ) . collect ( toList ( ) ) ) ; } | Delete filtered firewall policy |
1,898 | public OperationFuture < List < FirewallPolicy > > delete ( List < FirewallPolicy > firewallPolicyList ) { List < JobFuture > jobs = firewallPolicyList . stream ( ) . map ( reference -> delete ( reference ) . jobFuture ( ) ) . collect ( toList ( ) ) ; return new OperationFuture < > ( firewallPolicyList , new ParallelJo... | Delete firewall policy list |
1,899 | public OperationFuture < AlertPolicy > create ( AlertPolicyConfig createConfig ) { AlertPolicyMetadata policy = client . createAlertPolicy ( converter . buildCreateAlertPolicyRequest ( createConfig ) ) ; return new OperationFuture < > ( AlertPolicy . refById ( policy . getId ( ) ) , new NoWaitingJobFuture ( ) ) ; } | Create Alert policy |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.