Filter the pool events
@param data The data
@return The filtered events
@exception Exception If an error occurs
517169
public static List<TraceEvent> filterPoolEvents(List<TraceEvent> data) throws Exception
   {
      List<TraceEvent> result = new ArrayList<TraceEvent>();

      for (TraceEvent te : data)
      {
         if (te.getType() == TraceEvent.CREATE_CONNECTION_LISTENER_GET ||
             te.getType() == TraceEvent.CREATE_CONNECTION_LISTENER_PREFILL ||
             te.getType() == TraceEvent.CREATE_CONNECTION_LISTENER_INCREMENTER ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_RETURN ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_IDLE ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_INVALID ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_FLUSH ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_ERROR ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_PREFILL ||
             te.getType() == TraceEvent.DESTROY_CONNECTION_LISTENER_INCREMENTER ||
             te.getType() == TraceEvent.MANAGED_CONNECTION_POOL_CREATE ||
             te.getType() == TraceEvent.MANAGED_CONNECTION_POOL_DESTROY ||
             te.getType() == TraceEvent.PUSH_CCM_CONTEXT ||
             te.getType() == TraceEvent.POP_CCM_CONTEXT ||
             te.getType() == TraceEvent.REGISTER_CCM_CONNECTION ||
             te.getType() == TraceEvent.UNREGISTER_CCM_CONNECTION ||
             te.getType() == TraceEvent.CCM_USER_TRANSACTION ||
             te.getType() == TraceEvent.UNKNOWN_CCM_CONNECTION ||
             te.getType() == TraceEvent.CLOSE_CCM_CONNECTION ||
             te.getType() == TraceEvent.VERSION)
            continue;
         
         result.add(te);
      }

      return result;
   }
55347
@Beta
    public <R, E extends Exception, E2 extends Exception> List<R> filterThenFlatMap(final Try.Predicate<? super T, E> filter,
            final Try.Function<? super T, ? extends Collection<? extends R>, E2> mapper) throws E, E2 {
        N.checkArgNotNull(filter);
        N.checkArgNotNull(mapper);

        final List<R> result = new ArrayList<>();

        Collection<? extends R> c = null;

        for (T e : coll) {
            if (filter.test(e)) {
                c = mapper.apply(e);

                if (N.notNullOrEmpty(c)) {
                    result.addAll(c);
                }
            }
        }

        return result;
    }
1197856
public <E extends Exception> boolean allMatch(Try.LongPredicate<E> filter) throws E {
        return allMatch(0, size(), filter);
    }
645440
public final EventFilterParser.filter_return filter() throws RecognitionException {
        EventFilterParser.filter_return retval = new EventFilterParser.filter_return();
        retval.start = input.LT(1);


        CommonTree root_0 = null;

        Token OR1=null;
        Token EOF2=null;
        EventFilterParser.boolean_expr_return a =null;

        EventFilterParser.boolean_expr_return b =null;


        CommonTree OR1_tree=null;
        CommonTree EOF2_tree=null;
        RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
        RewriteRuleTokenStream stream_OR=new RewriteRuleTokenStream(adaptor,"token OR");
        RewriteRuleSubtreeStream stream_boolean_expr=new RewriteRuleSubtreeStream(adaptor,"rule boolean_expr");
        try {
            // EventFilter.g:103:2: ( (a= boolean_expr -> $a) ( OR b= boolean_expr -> ^( OR $filter $b) )* ( EOF )? )
            // EventFilter.g:103:4: (a= boolean_expr -> $a) ( OR b= boolean_expr -> ^( OR $filter $b) )* ( EOF )?
            {
            // EventFilter.g:103:4: (a= boolean_expr -> $a)
            // EventFilter.g:103:5: a= boolean_expr
            {
            pushFollow(FOLLOW_boolean_expr_in_filter323);
            a=boolean_expr();

            state._fsp--;

            stream_boolean_expr.add(a.getTree());

            // AST REWRITE
            // elements: a
            // token labels:
            // rule labels: retval, a
            // token list labels:
            // rule list labels:
            // wildcard labels:
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
            RewriteRuleSubtreeStream stream_a=new RewriteRuleSubtreeStream(adaptor,"rule a",a!=null?a.tree:null);

            root_0 = (CommonTree)adaptor.nil();
            // 103:19: -> $a
            {
                adaptor.addChild(root_0, stream_a.nextTree());

            }


            retval.tree = root_0;

            }


            // EventFilter.g:103:25: ( OR b= boolean_expr -> ^( OR $filter $b) )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==OR) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // EventFilter.g:103:26: OR b= boolean_expr
            	    {
            	    OR1=(Token)match(input,OR,FOLLOW_OR_in_filter330);
            	    stream_OR.add(OR1);


            	    pushFollow(FOLLOW_boolean_expr_in_filter334);
            	    b=boolean_expr();

            	    state._fsp--;

            	    stream_boolean_expr.add(b.getTree());

            	    // AST REWRITE
            	    // elements: OR, filter, b
            	    // token labels:
            	    // rule labels: retval, b
            	    // token list labels:
            	    // rule list labels:
            	    // wildcard labels:
            	    retval.tree = root_0;
            	    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
            	    RewriteRuleSubtreeStream stream_b=new RewriteRuleSubtreeStream(adaptor,"rule b",b!=null?b.tree:null);

            	    root_0 = (CommonTree)adaptor.nil();
            	    // 103:44: -> ^( OR $filter $b)
            	    {
            	        // EventFilter.g:103:47: ^( OR $filter $b)
            	        {
            	        CommonTree root_1 = (CommonTree)adaptor.nil();
            	        root_1 = (CommonTree)adaptor.becomeRoot(
            	        new OrTreeNode(stream_OR.nextToken())
            	        , root_1);

            	        adaptor.addChild(root_1, stream_retval.nextTree());

            	        adaptor.addChild(root_1, stream_b.nextTree());

            	        adaptor.addChild(root_0, root_1);
            	        }

            	    }


            	    retval.tree = root_0;

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            // EventFilter.g:103:79: ( EOF )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==EOF) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // EventFilter.g:103:79: EOF
                    {
                    EOF2=(Token)match(input,EOF,FOLLOW_EOF_in_filter354);
                    stream_EOF.add(EOF2);


                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);


            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }

        finally {
        	// do for sure before leaving
        }
        return retval;
    }
1281811
protected PollItem filter(final Object socketOrChannel, int events)
    {
        if (socketOrChannel == null) {
            return null;
        }
        CompositePollItem item = items.get(socketOrChannel);
        if (item == null) {
            return null;
        }
        PollItem pollItem = item.item();
        if (pollItem == null) {
            return null;
        }
        if (pollItem.hasEvent(events)) {
            return pollItem;
        }
        return null;
    }
261844
public List<EventBase> getEventsList() throws Exception {
        final String eventsPath = StringUtils.join(new String[]{
                getUri(),
                "events"
        }, '/');
        final JSONArray array = toJSONArray(client.get(eventsPath, null));

        final List<EventBase> list = new ArrayList<EventBase>();
        for (final Object object : array) {
            list.add(new EventBase((JSONObject) object));
        }
        return list;
    }
603743
public static <T, E extends Exception> List<T> filter(final T[] a, final int fromIndex, final int toIndex, final Try.Predicate<? super T, E> filter,
            final int max) throws E {
        checkFromToIndex(fromIndex, toIndex, len(a));
        N.checkArgNotNull(filter);

        if (N.isNullOrEmpty(a)) {
            return new ArrayList<>();
        }

        final List<T> result = new ArrayList<>(min(9, max, (toIndex - fromIndex)));

        for (int i = fromIndex, cnt = 0; i < toIndex && cnt < max; i++) {
            if (filter.test(a[i])) {
                result.add(a[i]);
                cnt++;
            }
        }

        return result;
    }
189468
public void filterOnAllData( final ALasDataManager lasHandler ) throws Exception {
        final ConcurrentSkipListSet<Double> angleSet = new ConcurrentSkipListSet<Double>();
        final ConcurrentSkipListSet<Double> distanceSet = new ConcurrentSkipListSet<Double>();

        if (isFirstStatsCalculation) {
            pm.beginTask("Calculating initial statistics...", tinGeometries.length);
        } else {
            pm.beginTask("Filtering all data on seeds tin...", tinGeometries.length);
        }
        try {
            final List<Coordinate> newTotalLeftOverCoordinateList = new ArrayList<Coordinate>();
            if (threadsNum > 1) {
                // multithreaded
                ThreadedRunnable tRun = new ThreadedRunnable(threadsNum, null);
                for( final Geometry tinGeom : tinGeometries ) {
                    tRun.executeRunnable(new Runnable(){
                        public void run() {
                            List<Coordinate> leftOverList = runFilterOnAllData(lasHandler, angleSet, distanceSet, tinGeom);
                            synchronized (newTotalLeftOverCoordinateList) {
                                newTotalLeftOverCoordinateList.addAll(leftOverList);
                            }
                        }
                    });
                }
                tRun.waitAndClose();
            } else {
                for( final Geometry tinGeom : tinGeometries ) {
                    List<Coordinate> leftOverList = runFilterOnAllData(lasHandler, angleSet, distanceSet, tinGeom);
                    newTotalLeftOverCoordinateList.addAll(leftOverList);
                }
            }
            pm.done();

            leftOverCoordinateList.clear();
            leftOverCoordinateList.addAll(newTotalLeftOverCoordinateList);

            /*
             * now recalculate the thresholds
             */
            if (angleSet.size() > 1) {
                calculatedAngleThreshold = getMedianFromSet(angleSet);
                pm.message("Calculated angle threshold: " + calculatedAngleThreshold + " (range: " + angleSet.first() + " to "
                        + angleSet.last() + ")");
            } else if (angleSet.size() == 0) {
                return;
            } else {
                calculatedAngleThreshold = angleSet.first();
                pm.message("Single angle left: " + calculatedAngleThreshold);
            }

            if (distanceSet.size() > 1) {
                calculatedDistanceThreshold = getMedianFromSet(distanceSet);
                pm.message("Calculated distance threshold: " + calculatedDistanceThreshold + " (range: " + distanceSet.first()
                        + " to " + distanceSet.last() + ")");
            } else if (distanceSet.size() == 0) {
                return;
            } else {
                calculatedDistanceThreshold = distanceSet.first();
                pm.message("Single distance left: " + calculatedDistanceThreshold);
            }
            if (isFirstStatsCalculation) {
                isFirstStatsCalculation = false;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
674604
private void processCalendars() throws Exception
   {
      List<Row> rows = getRows("select * from zcalendar where zproject=?", m_projectID);
      for (Row row : rows)
      {
         ProjectCalendar calendar = m_project.addCalendar();
         calendar.setUniqueID(row.getInteger("Z_PK"));
         calendar.setName(row.getString("ZTITLE"));
         processDays(calendar);
         processExceptions(calendar);
         m_eventManager.fireCalendarReadEvent(calendar);
      }
   }
849211
@Override
    public EventPipeline newEventPipeline(ExecutorService executorService) {
        return new CheckingPipelineFilter(
            new EventProcessor(tree(), executorService), channel());
    }
980953
public void setThisData(byte[] data)
    {
        try
        {
            pen.setData(data);
        }
        catch ( Exception e )
        {
            ThreadUtils.checkInterrupted(e);
            Throwables.propagate(e);
        }
    }
341269
public static ServerSentEvent withEventType(ByteBuf eventType, ByteBuf data) {
        return new ServerSentEvent(null, eventType, data);
    }
847671
public Object[] getGroupData(Object[] data) {

        if (isSimpleAggregate) {
            if (simpleAggregateData == null) {
                simpleAggregateData = data;

                return null;
            }

            return simpleAggregateData;
        }

        RowIterator it = groupIndex.findFirstRow(session, store, data);

        if (it.hasNext()) {
            Row row = it.getNextRow();

            if (isAggregate) {
                row.setChanged();
            }

            return row.getData();
        }

        return null;
    }
81905
public static Map<String, List<Interaction>> getPoolData(List<TraceEvent> data,
                                                            boolean ignoreDelist, boolean ignoreTracking,
                                                            boolean ignoreIncomplete)
   {
      // Pool -> Interactions
      Map<String, List<Interaction>> result = new TreeMap<String, List<Interaction>>();
      
      // Pool -> ConnectionListener -> Events
      Map<String, Map<String, List<TraceEvent>>> temp = new TreeMap<String, Map<String, List<TraceEvent>>>();

      for (int i = 0; i < data.size(); i++)
      {
         TraceEvent te = data.get(i);

         Map<String, List<TraceEvent>> m = temp.get(te.getPool());

         if (m == null)
            m = new TreeMap<String, List<TraceEvent>>();

         List<TraceEvent> l = m.get(te.getConnectionListener());

         if (l == null)
            l = new ArrayList<TraceEvent>();

         l.add(te);

         if (isEndState(te))
         {
            Interaction interaction = new Interaction(te.getThreadId(),
                                                      l.get(0).getTimestamp(),
                                                      l.get(l.size() - 1).getTimestamp(),
                                                      l,
                                                      getStatus(l, ignoreDelist, ignoreTracking, ignoreIncomplete));
            List<Interaction> pool = result.get(te.getPool());

            if (pool == null)
               pool = new ArrayList<Interaction>();

            pool.add(interaction);
            result.put(te.getPool(), pool);
            l = null;
         }
         
         m.put(te.getConnectionListener(), l);
         temp.put(te.getPool(), m);
      }

      if (!ignoreIncomplete)
      {
         for (Map.Entry<String, Map<String, List<TraceEvent>>> poolEntry : temp.entrySet())
         {
            for (Map.Entry<String, List<TraceEvent>> clEntry : poolEntry.getValue().entrySet())
            {
               List<TraceEvent> l = clEntry.getValue();

               if (l != null)
               {
                  Interaction interaction = new Interaction(l.get(0).getThreadId(),
                                                            l.get(0).getTimestamp(),
                                                            l.get(l.size() - 1).getTimestamp(),
                                                            l,
                                                            getStatus(l, ignoreDelist, ignoreTracking,
                                                                      ignoreIncomplete));
                  List<Interaction> pool = result.get(poolEntry.getKey());
               
                  if (pool == null)
                     pool = new ArrayList<Interaction>();

                  pool.add(interaction);
                  result.put(poolEntry.getKey(), pool);
               }
            }
         }
      }
      
      return result;
   }
392700
@Override
    public boolean filter(Object data) {
        logger.entering(data);
        String[] keyValues = filterKeyValues.split(",");
        String tempKey = null;
        Field field;

        try {
            field = data.getClass().getDeclaredField(filterKeyName);
            field.setAccessible(true);
            for (String keyValue : keyValues) {
                tempKey = keyValue;
                if (field.get(data) != null && field.get(data).toString().trim().equals(keyValue)) {
                    logger.exiting(true);
                    return true;
                }
            }
        } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
            throw new DataProviderException("Row with key '" + tempKey + "' is not found for given filter key '"
                    + filterKeyName + "'", e);
        }
        logger.exiting(false);
        return false;
    }
695814
private boolean filter(Event event) {
        for (EventFilter filter : eventFilters) {
            if (filter.filter(event)) {
                return true;
            }
        }
        return false;
    }
521225
public boolean filter(Event event) {
        LOG.info("StringContentFilter called");
        
        if (wordsToFilter != null) {
            for (String filterWord : wordsToFilter) {
                if (event.getContent() != null
                        && -1 != event.getContent().indexOf(filterWord)) {
                    return true;
                }
            }
        }
        return false;
    }