Package java.util.concurrent

Examples of java.util.concurrent.TimeUnit.convert()


        String optionValue = options.get(TIMESTAMP_RESOLUTION_KEY);
        TimeUnit timestampResolution = optionValue == null ? DEFAULT_TIMESTAMP_RESOLUTION : TimeUnit.valueOf(optionValue);
        optionValue = options.get(MAX_SSTABLE_AGE_KEY);
        maxSSTableAge = timestampResolution.convert(optionValue == null ? DEFAULT_MAX_SSTABLE_AGE_DAYS : Long.parseLong(optionValue), TimeUnit.DAYS);
        optionValue = options.get(BASE_TIME_KEY);
        baseTime = timestampResolution.convert(optionValue == null ? DEFAULT_BASE_TIME_SECONDS : Long.parseLong(optionValue), TimeUnit.SECONDS);
    }

    public DateTieredCompactionStrategyOptions()
    {
        maxSSTableAge = DEFAULT_TIMESTAMP_RESOLUTION.convert(DEFAULT_MAX_SSTABLE_AGE_DAYS, TimeUnit.DAYS);
View Full Code Here


        TimeUnit freqUnit = ctx.scheduler().frequencyUnit();
        if (TimeUnit.DAYS == freqUnit) {
            runsPerDay = ctx.scheduler().frequency();
        } else {
            long units = freqUnit.convert(close.getTimeInMillis() - open.getTimeInMillis(), TimeUnit.MILLISECONDS);
            runsPerDay = units / ctx.scheduler().frequency();
        }
    }

    /** {@inheritDoc} */
 
View Full Code Here

            TimeUnit tu = getSelectedTimeUnit(combo);
            long timeInMilli = (long) getTimeInMilliseconds(t, tu);
            long limit = (long) (bounds.getHigh() - bounds.getLow());
            if (i < 1 || timeInMilli > limit) {
                String message = NbBundle.getMessage(DynamicSettingsPanel.class,
                        "DateRangeValidator.NotInRange", i, 1, tu.convert(limit, TimeUnit.MILLISECONDS));
                prblms.add(message);
                return false;
            }
            return true;
        }
View Full Code Here

        throw notTimeUnit(section, subsection, name, valStr);
      }

      if (unit == TimeUnit.MILLISECONDS) {
        TimeUnit newUnit = TimeUnit.NANOSECONDS;
        long t = (long) (inputTime * newUnit.convert(1, unit));
        return new Timeout(t, newUnit);

      } else if (unit == TimeUnit.SECONDS && multiplier == 1) {
        TimeUnit newUnit = TimeUnit.MILLISECONDS;
        long t = (long) (inputTime * newUnit.convert(1, unit));
View Full Code Here

        long t = (long) (inputTime * newUnit.convert(1, unit));
        return new Timeout(t, newUnit);

      } else if (unit == TimeUnit.SECONDS && multiplier == 1) {
        TimeUnit newUnit = TimeUnit.MILLISECONDS;
        long t = (long) (inputTime * newUnit.convert(1, unit));
        return new Timeout(t, newUnit);

      } else {
        return new Timeout((long) inputTime, unit);
      }
View Full Code Here

    private void refreshWindowTimeUnit() {
        TimeUnit tu = getSelectedTimeUnit(windowTimeUnitCombo.getModel());
        try {
            Integer value = Integer.parseInt(windowTextField.getText());
            long newValue = tu.convert(value, windowTimeUnit);
            windowTextField.setText("" + newValue);
            windowTimeUnit = tu;
        } catch (Exception e) {
        }
    }
View Full Code Here

    private void refreshTickTimeUnit() {
        TimeUnit tu = getSelectedTimeUnit(tickTimeUnitCombo.getModel());
        try {
            Integer value = Integer.parseInt(tickTextField.getText());
            long newValue = tu.convert(value, tickTimeUnit);
            tickTextField.setText("" + newValue);
            tickTimeUnit = tu;
        } catch (Exception e) {
        }
    }
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.