Examples of LongRange


Examples of com.baulsupp.kolja.log.util.LongRange

        long chunkSize = getChunkSize(workers, length);

        while (offset < length) {
          long to = Math.min(offset + chunkSize, length);
          result.add(new FileSection(f, new LongRange(offset, to)));
          offset = to;
        }
      }
    }
View Full Code Here

Examples of com.google.uzaygezen.core.ranges.LongRange

        regionInspector, combiner, 1, true, LongRangeHome.INSTANCE, TestUtils.ZERO_LONG_CONTENT);
      chc.accept(new ZoomingSpaceVisitorAdapter(chc, queryBuilder));
      Query<RangeListFilter<Long, LongContent, LongRange>, LongRange> actual = queryBuilder.get();
      chc.index(p, 0, chi);
      long pointCompactHilbertIndex = chi.toExactLong();
      LongRange expectedSingleRange = LongRange.of(
        pointCompactHilbertIndex, pointCompactHilbertIndex + 1);
      FilteredIndexRange<RangeListFilter<Long, LongContent, LongRange>, LongRange> expectedIndexQueryRange = FilteredIndexRange.of(
        expectedSingleRange,
        new RangeListFilter<Long, LongContent, LongRange>(
          ImmutableList.of(expectedSingleRange), false, Level.FINE, LongRangeHome.INSTANCE), false);
View Full Code Here

Examples of com.google.uzaygezen.core.ranges.LongRange

    RegionInspector<RangeListFilter<Long, LongContent, LongRange>, LongContent> regionInspector = SimpleRegionInspector.create(
      ImmutableList.of(ImmutableList.<LongRange>of(TestUtils.TWO_SIX, TestUtils.TWO_FOUR)),
      TestUtils.ONE_LONG_CONTENT, RangeListFilter.creator(Level.FINE, LongRangeHome.INSTANCE),
      LongRangeHome.INSTANCE, TestUtils.ZERO_LONG_CONTENT);
    CompactHilbertCurve chc = new CompactHilbertCurve(new int[] {3, 3});
    LongRange expectedRange1 = LongRange.of(8, 12);
    LongRange expectedRange2 = LongRange.of(52, 56);
    FilteredIndexRange<RangeListFilter<Long, LongContent, LongRange>, LongRange> expectedIndexQueryRange1 = FilteredIndexRange.of(
      expectedRange1,
      new RangeListFilter<Long, LongContent, LongRange>(
        ImmutableList.of(expectedRange1), false, Level.FINE, LongRangeHome.INSTANCE), false);
    FilteredIndexRange<RangeListFilter<Long, LongContent, LongRange>, LongRange> expectedIndexQueryRange2 = FilteredIndexRange.of(
View Full Code Here

Examples of com.jidesoft.range.LongRange

            }
            if (v > max) {
                max = v;
            }
        }
        return new LongRange((long) min, (long) max);
    }
View Full Code Here

Examples of org.apache.commons.lang.math.LongRange

   
    // Create Date Filter
    if (null != start) {
      if (end == null)
        end = new Date(System.currentTimeMillis());
      dateFilter = new LongRange(start.getTime(), end.getTime());
    }
   
    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
View Full Code Here

Examples of org.apache.commons.lang.math.LongRange

    // Create Date Filter
    if (null != start) {
      if (end == null)
        end = new Date(System.currentTimeMillis());
      dateFilter = new LongRange(start.getTime(), end.getTime());
    }

    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
View Full Code Here

Examples of org.apache.commons.lang.math.LongRange

        request.getApplicationStates();
    Set<String> users = request.getUsers();
    Set<String> queues = request.getQueues();
    Set<String> tags = request.getApplicationTags();
    long limit = request.getLimit();
    LongRange start = request.getStartRange();
    LongRange finish = request.getFinishRange();
    ApplicationsRequestScope scope = request.getScope();

    final Map<ApplicationId, RMApp> apps = rmContext.getRMApps();
    Iterator<RMApp> appsIter;
    // If the query filters by queues, we can avoid considering apps outside
    // of those queues by asking the scheduler for the apps in those queues.
    if (queues != null && !queues.isEmpty()) {
      // Construct an iterator over apps in given queues
      // Collect list of lists to avoid copying all apps
      final List<List<ApplicationAttemptId>> queueAppLists =
          new ArrayList<List<ApplicationAttemptId>>();
      for (String queue : queues) {
        List<ApplicationAttemptId> appsInQueue = scheduler.getAppsInQueue(queue);
        if (appsInQueue != null && !appsInQueue.isEmpty()) {
          queueAppLists.add(appsInQueue);
        }
      }
      appsIter = new Iterator<RMApp>() {
        Iterator<List<ApplicationAttemptId>> appListIter = queueAppLists.iterator();
        Iterator<ApplicationAttemptId> schedAppsIter;

        @Override
        public boolean hasNext() {
          // Because queueAppLists has no empty lists, hasNext is whether the
          // current list hasNext or whether there are any remaining lists
          return (schedAppsIter != null && schedAppsIter.hasNext())
              || appListIter.hasNext();
        }
        @Override
        public RMApp next() {
          if (schedAppsIter == null || !schedAppsIter.hasNext()) {
            schedAppsIter = appListIter.next().iterator();
          }
          return apps.get(schedAppsIter.next().getApplicationId());
        }
        @Override
        public void remove() {
          throw new UnsupportedOperationException("Remove not supported");
        }
      };
    } else {
      appsIter = apps.values().iterator();
    }
   
    List<ApplicationReport> reports = new ArrayList<ApplicationReport>();
    while (appsIter.hasNext() && reports.size() < limit) {
      RMApp application = appsIter.next();

      // Check if current application falls under the specified scope
      boolean allowAccess = checkAccess(callerUGI, application.getUser(),
          ApplicationAccessType.VIEW_APP, application);
      if (scope == ApplicationsRequestScope.OWN &&
          !callerUGI.getUserName().equals(application.getUser())) {
        continue;
      } else if (scope == ApplicationsRequestScope.VIEWABLE && !allowAccess) {
        continue;
      }

      if (applicationTypes != null && !applicationTypes.isEmpty()) {
        String appTypeToMatch = caseSensitive
            ? application.getApplicationType()
            : application.getApplicationType().toLowerCase();
        if (!applicationTypes.contains(appTypeToMatch)) {
          continue;
        }
      }

      if (applicationStates != null && !applicationStates.isEmpty()) {
        if (!applicationStates.contains(application
            .createApplicationState())) {
          continue;
        }
      }

      if (users != null && !users.isEmpty() &&
          !users.contains(application.getUser())) {
        continue;
      }

      if (start != null && !start.containsLong(application.getStartTime())) {
        continue;
      }

      if (finish != null && !finish.containsLong(application.getFinishTime())) {
        continue;
      }

      if (tags != null && !tags.isEmpty()) {
        Set<String> appTags = application.getApplicationTags();
View Full Code Here

Examples of org.apache.commons.lang.math.LongRange

   
    // Create Date Filter
    if (null != start) {
      if (end == null)
        end = new Date(System.currentTimeMillis());
      dateFilter = new LongRange(start.getTime(), end.getTime());
    }
   
    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
View Full Code Here

Examples of org.apache.commons.lang.math.LongRange

   
    // Create Date Filter
    if (null != start) {
      if (end == null)
        end = new Date(System.currentTimeMillis());
      dateFilter = new LongRange(start.getTime(), end.getTime());
    }
   
    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
View Full Code Here

Examples of org.apache.commons.lang.math.LongRange

   
    // Create Date Filter
    if (null != start) {
      if (end == null)
        end = new Date(System.currentTimeMillis());
      dateFilter = new LongRange(start.getTime(), end.getTime());
    }
   
    if (null != level) {
      Level base = Level.toLevel(level.toUpperCase());
      levelFilter = new LevelRangeFilter();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.