List of usage examples for java.lang Long MIN_VALUE
long MIN_VALUE
To view the source code for java.lang Long MIN_VALUE.
Click Source Link
From source file:com.linkedin.pinot.core.realtime.converter.stats.RealtimeNoDictionaryColStatistics.java
private void computeLongMinMax(int[] rows) { long values[] = new long[_numDocIds]; _blockValSet.getLongValues(rows, 0, _numDocIds, values, 0); long min = Long.MAX_VALUE; long max = Long.MIN_VALUE; for (int i = 0; i < _numDocIds; i++) { if (values[i] < min) { min = values[i];//from w w w. jav a2s . c o m } if (values[i] > max) { max = values[i]; } } _minValue = Long.valueOf(min); _maxValue = Long.valueOf(max); }
From source file:it.unibo.alchemist.boundary.monitors.EnvironmentInspector.java
@Override public void finished(final Environment<T> env, final Time time, final long step) { if (writer != null) { writer.close();// w w w. j av a 2s.c om } writer = null; lastUpdate = Double.NEGATIVE_INFINITY; lastStep = Long.MIN_VALUE; fpCache = null; }
From source file:org.ajax4jsf.resource.InternetResourceBase.java
public long getExpired(ResourceContext resourceContext) { if (expired == Long.MIN_VALUE) { expired = -1;//from w ww . j a va 2s.com String defaultExpireParameter = resourceContext .getInitParameter(InternetResource.DEFAULT_EXPITE_PARAMETER); if (null != defaultExpireParameter) { expired = Long.parseLong(defaultExpireParameter) * 1000L; } } return expired; }
From source file:org.apache.hadoop.dfs.TestDFSStartupVersions.java
/** * Initialize the versions array. This array stores all combinations * of cross product:// w ww .j a v a 2s.co m * {oldLayoutVersion,currentLayoutVersion,futureLayoutVersion} X * {currentNamespaceId,incorrectNamespaceId} X * {pastFsscTime,currentFsscTime,futureFsscTime} */ private StorageInfo[] initializeVersions() throws Exception { int layoutVersionOld = Storage.LAST_UPGRADABLE_LAYOUT_VERSION; int layoutVersionCur = UpgradeUtilities.getCurrentLayoutVersion(); int layoutVersionNew = Integer.MIN_VALUE; int namespaceIdCur = UpgradeUtilities.getCurrentNamespaceID(null); int namespaceIdOld = Integer.MIN_VALUE; long fsscTimeOld = Long.MIN_VALUE; long fsscTimeCur = UpgradeUtilities.getCurrentFsscTime(null); long fsscTimeNew = Long.MAX_VALUE; return new StorageInfo[] { new StorageInfo(layoutVersionOld, namespaceIdCur, fsscTimeOld), // 0 new StorageInfo(layoutVersionOld, namespaceIdCur, fsscTimeCur), // 1 new StorageInfo(layoutVersionOld, namespaceIdCur, fsscTimeNew), // 2 new StorageInfo(layoutVersionOld, namespaceIdOld, fsscTimeOld), // 3 new StorageInfo(layoutVersionOld, namespaceIdOld, fsscTimeCur), // 4 new StorageInfo(layoutVersionOld, namespaceIdOld, fsscTimeNew), // 5 new StorageInfo(layoutVersionCur, namespaceIdCur, fsscTimeOld), // 6 new StorageInfo(layoutVersionCur, namespaceIdCur, fsscTimeCur), // 7 new StorageInfo(layoutVersionCur, namespaceIdCur, fsscTimeNew), // 8 new StorageInfo(layoutVersionCur, namespaceIdOld, fsscTimeOld), // 9 new StorageInfo(layoutVersionCur, namespaceIdOld, fsscTimeCur), // 10 new StorageInfo(layoutVersionCur, namespaceIdOld, fsscTimeNew), // 11 new StorageInfo(layoutVersionNew, namespaceIdCur, fsscTimeOld), // 12 new StorageInfo(layoutVersionNew, namespaceIdCur, fsscTimeCur), // 13 new StorageInfo(layoutVersionNew, namespaceIdCur, fsscTimeNew), // 14 new StorageInfo(layoutVersionNew, namespaceIdOld, fsscTimeOld), // 15 new StorageInfo(layoutVersionNew, namespaceIdOld, fsscTimeCur), // 16 new StorageInfo(layoutVersionNew, namespaceIdOld, fsscTimeNew), // 17 }; }
From source file:org.apache.drill.exec.server.rest.profile.OperatorWrapper.java
public String getContent() { TableBuilder builder = new TableBuilder(OPERATOR_COLUMNS); for (ImmutablePair<OperatorProfile, Integer> ip : ops) { int minor = ip.getRight(); OperatorProfile op = ip.getLeft(); String path = new OperatorPathBuilder().setMajor(major).setMinor(minor).setOperator(op).build(); builder.appendCell(path, null);/* w w w . j ava2 s.c o m*/ builder.appendNanos(op.getSetupNanos(), null); builder.appendNanos(op.getProcessNanos(), null); builder.appendNanos(op.getWaitNanos(), null); long maxBatches = Long.MIN_VALUE; long maxRecords = Long.MIN_VALUE; for (StreamProfile sp : op.getInputProfileList()) { maxBatches = Math.max(sp.getBatches(), maxBatches); maxRecords = Math.max(sp.getRecords(), maxRecords); } builder.appendFormattedInteger(maxBatches, null); builder.appendFormattedInteger(maxRecords, null); builder.appendBytes(op.getPeakLocalMemoryAllocated(), null); } return builder.build(); }
From source file:me.geenee.conf.SampleDataConfiguration.java
/** * Generates random set of tags.//from ww w .jav a 2 s .c o m * @return Set of tags. * @checkstyle ParameterNameCheck (25 lines) */ private Set<Tag> randomTags() { final int amount = this.random(1, TAGS_AMOUNT); final Set<Tag> result = new TreeSet<>(new Comparator<Tag>() { @Override public int compare(final Tag o1, final Tag o2) { Long first = Long.MIN_VALUE; Long second = Long.MIN_VALUE; if (o1 != null) { first = o1.getId(); } if (o2 != null) { second = o2.getId(); } return first.compareTo(second); } }); for (int idx = 0; idx < amount; ++idx) { result.add(this.tags.findOne((long) this.random(1, TAGS_AMOUNT))); } return result; }
From source file:com.opengamma.util.timeseries.fast.longint.FastArrayLongDoubleTimeSeries.java
private void init(final long[] times, final double[] values) { if (times.length != values.length) { throw new IllegalArgumentException( "Arrays are of different sizes: " + times.length + ", " + values.length); }/*from w ww. j a v a 2 s . co m*/ System.arraycopy(times, 0, _times, 0, times.length); System.arraycopy(values, 0, _values, 0, values.length); // check dates are ordered long maxTime = Long.MIN_VALUE; for (final long time : _times) { if (time < maxTime) { throw new IllegalArgumentException("dates must be ordered"); } maxTime = time; } }
From source file:com.cloudera.oryx.common.collection.LongSetTest.java
@Test public void testReservedValues() { LongSet set = new LongSet(); try {/*from w w w . ja v a 2 s .co m*/ set.add(Long.MIN_VALUE); fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException iae) { // good } assertFalse(set.contains(Long.MIN_VALUE)); try { set.add(Long.MAX_VALUE); fail("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException iae) { // good } assertFalse(set.contains(Long.MAX_VALUE)); }
From source file:org.apache.flink.streaming.connectors.kinesis.util.WatermarkTrackerTest.java
@Test public void test() { long watermark = 0; TestWatermarkTracker ws = new TestWatermarkTracker(); ws.open(new MockStreamingRuntimeContext(false, 1, 0)); Assert.assertEquals(Long.MIN_VALUE, ws.updateWatermark(Long.MIN_VALUE)); Assert.assertEquals(Long.MIN_VALUE, ws.updateWatermark(watermark)); // timeout wm1 clock.add(WatermarkTracker.DEFAULT_UPDATE_TIMEOUT_MILLIS + 1); Assert.assertEquals(watermark, ws.updateWatermark(watermark)); Assert.assertEquals(watermark, ws.updateWatermark(watermark - 1)); // min watermark wm1.watermark = watermark + 1;//ww w .jav a 2s . c o m wm1.lastUpdated = clock.longValue(); Assert.assertEquals(watermark, ws.updateWatermark(watermark)); Assert.assertEquals(watermark + 1, ws.updateWatermark(watermark + 1)); }
From source file:com.wabacus.system.task.TimingThread.java
public void run() { while (RUNNING_FLAG) { if (this.lstTasks == null || this.lstTasks.size() == 0) break; for (ITask taskObjTmp : lstTasks) { try { if (taskObjTmp.shouldExecute()) taskObjTmp.execute(); } catch (Exception e) { log.error("" + taskObjTmp.getTaskId() + "", e); }//from w w w .j a v a 2 s. co m } if (this.intervalMilSeconds == Long.MIN_VALUE) { intervalMilSeconds = Config.getInstance().getSystemConfigValue("timing-thread-interval", 15) * 1000L; if (intervalMilSeconds <= 0) intervalMilSeconds = 15 * 1000L; } if (this.intervalMilSeconds > 0) { try { Thread.sleep(this.intervalMilSeconds); } catch (InterruptedException e) { log.warn("wabacus???", e); } } } }