Example usage for java.lang Long MAX_VALUE

List of usage examples for java.lang Long MAX_VALUE

Introduction

In this page you can find the example usage for java.lang Long MAX_VALUE.

Prototype

long MAX_VALUE

To view the source code for java.lang Long MAX_VALUE.

Click Source Link

Document

A constant holding the maximum value a long can have, 263-1.

Usage

From source file:com.streamsets.pipeline.stage.it.AvroToParquetHiveIT.java

@Parameterized.Parameters(name = "type({0})")
public static Collection<Object[]> data() throws Exception {
    return Arrays.asList(new Object[][] {
            // Primitive types
            { "\"boolean\"", true, true, "BOOLEAN", Types.BOOLEAN, "0" },
            { "\"int\"", Integer.MIN_VALUE, Integer.MIN_VALUE, "INT", Types.INTEGER, "0" },
            { "\"long\"", Long.MAX_VALUE, Long.MAX_VALUE, "BIGINT", Types.BIGINT, "0" },
            // From some reason type is FLOAT, but returned object is double
            { "\"float\"", Float.NaN, Double.NaN, "FLOAT", Types.FLOAT, "0" },
            { "\"double\"", Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY, "DOUBLE", Types.DOUBLE, "0" },
            { "\"bytes\"", ByteBuffer.wrap(new byte[] { (byte) 0x00, (byte) 0xFF }),
                    new byte[] { (byte) 0x00, (byte) 0xFF }, "BINARY", Types.BINARY, "1.0" },
            { "\"string\"", new Utf8("StreamSets"), "StreamSets", "STRING", Types.VARCHAR, "1.0" },

            // Complex types are skipped for now

            // Logical types
            { DECIMAL.toString(), ByteBuffer.wrap(new byte[] { (byte) 0x0F }), new BigDecimal("2"), "DECIMAL",
                    Types.DECIMAL, "0" },
            { DATE.toString(), 17039, new java.sql.Date(116, 7, 26), "DATE", Types.DATE, "1.2" }, });
}

From source file:com.redhat.lightblue.ResponseTest.java

@Test
public void testWithModifiedCount() {
    node = JsonNodeFactory.withExactBigDecimals(true).numberNode(Long.MAX_VALUE);
    builder.withModifiedCount(node);/* w  w  w  .  ja  v  a2 s. c om*/
    assertTrue(new Long(Long.MAX_VALUE).equals(builder.buildResponse().getModifiedCount()));
}

From source file:com.liferay.portal.search.elasticsearch.internal.document.DefaultElasticsearchDocumentFactory.java

protected void addDates(XContentBuilder xContentBuilder, Field field) throws IOException {

    for (Date date : field.getDates()) {
        String value;//from www . j  av a  2s.  c o  m

        if (date.getTime() == Long.MAX_VALUE) {
            value = DATE_MAX_VALUE;
        } else {
            value = DATE_FORMAT.format(date);
        }

        xContentBuilder.value(value);
    }
}

From source file:input_format.MyLineRecordReader.java

public void initialize(InputSplit genericSplit, TaskAttemptContext context) throws IOException {
    MyFileSplit split = (MyFileSplit) (MyInputSplit) genericSplit;
    Configuration job = context.getConfiguration();
    this.maxLineLength = job.getInt("mapred.linerecordreader.maxlength", Integer.MAX_VALUE);
    start = split.getStart();//from   w  ww.j  a  v a2 s  .  c o  m
    end = start + split.getLength();
    final Path file = split.getPath();
    compressionCodecs = new CompressionCodecFactory(job);
    final CompressionCodec codec = compressionCodecs.getCodec(file);

    // open the file and seek to the start of the split
    FileSystem fs = file.getFileSystem(job);
    FSDataInputStream fileIn = fs.open(split.getPath());
    boolean skipFirstLine = false;
    if (codec != null) {
        in = new LineReader(codec.createInputStream(fileIn), job);
        end = Long.MAX_VALUE;
    } else {
        if (start != 0) {
            skipFirstLine = true;
            --start;
            fileIn.seek(start);
        }
        in = new LineReader(fileIn, job);
    }
    if (skipFirstLine) { // skip first line and re-establish "start".
        start += in.readLine(new Text(), 0, (int) Math.min((long) Integer.MAX_VALUE, end - start));
    }
    this.pos = start;
}

From source file:com.endgame.binarypig.loaders.AbstractFileDroppingLoader.java

public AbstractFileDroppingLoader() {
    this(Long.toString(Long.MAX_VALUE));
}

From source file:info.archinnov.achilles.it.TestEntityWithComplexCounter.java

@Test
public void should_find() throws Exception {
    //Given//from   w ww . j a  va  2  s . c  o  m
    final long id = RandomUtils.nextLong(0L, Long.MAX_VALUE);
    final UUID uuid = UUIDs.timeBased();
    final long count = RandomUtils.nextLong(0L, Long.MAX_VALUE);
    final long staticCount = RandomUtils.nextLong(0L, Long.MAX_VALUE);
    final long codecCount = RandomUtils.nextLong(0L, Long.MAX_VALUE);

    scriptExecutor.executeScriptTemplate("EntityWithComplexCounters/insert_single_row.cql", ImmutableMap
            .of("id", id, "uuid", uuid, "count", count, "staticCount", staticCount, "codecCount", codecCount));

    //When
    final EntityWithComplexCounters actual = manager.crud().findById(id, uuid).get();

    //Then
    assertThat(actual).isNotNull();
    assertThat(actual.getSimpleCounter()).isEqualTo(count);
    assertThat(actual.getStaticCounter()).isEqualTo(staticCount);
    assertThat(actual.getCounterWithCodec()).isEqualTo(codecCount + "");
}

From source file:info.archinnov.achilles.it.bugs.TestDSLUpdateWithTTLAndTimestamp.java

@Test
public void should_dsl_update_with_ttl() throws Exception {
    //Given/* w ww.  ja v  a2 s.c  o  m*/
    final long id = RandomUtils.nextLong(0L, Long.MAX_VALUE);
    final Date date = buildDateKey();
    scriptExecutor.executeScriptTemplate("SimpleEntity/insert_single_row.cql",
            ImmutableMap.of("id", id, "table", "simple"));

    manager.dsl().update().fromBaseTable().value().Set("new value").consistencyList()
            .Set(Arrays.asList(ConsistencyLevel.ALL)).where().id().Eq(id).date().Eq(date).usingTimeToLive(1)
            .usingTimestamp(new Date().getTime()).execute();

    //When
    Thread.sleep(2000);

    Row row = session
            .execute("SELECT * FROM simple WHERE id = " + id + " AND date = '2015-10-01 00:00:00.000+0000'")
            .one();

    //Then
    assertThat(row).isNotNull();
    assertThat(row.getList("consistencylist", String.class)).hasSize(2).containsExactly("QUORUM", "LOCAL_ONE");
    assertThat(row.getString("value")).isEqualTo("0 AM");

}

From source file:com.zimbra.common.util.BufferStreamRequestEntity.java

public BufferStreamRequestEntity(String contentType, long sizeHint, int maxBuffer) {
    this(null, contentType, sizeHint, maxBuffer, Long.MAX_VALUE);
}

From source file:com.kolich.blog.entities.MarkdownFile.java

/**
 * Renders this markdown file into HTML.  The resulting string is a partial UTF-8 encoded HTML
 * fragment that can be injected into a larger HTML page or JSON object.
 *///from w  w w  . j  a v a  2s .com
public final String getHtmlFromMarkdown() throws IOException {
    // https://github.com/markkolich/blog/issues/1
    // Set max parsing time to "infinity" such that the parsing
    // of lengthy markdown files will not timeout.
    final PegDownProcessor p = new PegDownProcessor(pegDownExtensions__, Long.MAX_VALUE);
    return p.markdownToHtml(readFileToString(file_, Charsets.UTF_8));
}

From source file:org.kiji.rest.util.RowResourceUtil.java

/**
 * Retrieves the Min..Max timestamp given the user specified time range. Min and Max represent
 * long-type time in milliseconds since the UNIX Epoch. e.g. '123..1234', '0..', or '..1234'.
 * (Default=0..)// www.  j  a  v a2  s.  c  om
 *
 * @param timeRange is the user supplied timerange.
 *
 * @return A long 2-tuple containing the min and max timestamps (in ms since UNIX Epoch)
 */
public static long[] getTimestamps(String timeRange) {

    long[] lReturn = new long[] { 0, Long.MAX_VALUE };
    final Pattern timestampPattern = Pattern.compile("([0-9]*)\\.\\.([0-9]*)");
    final Matcher timestampMatcher = timestampPattern.matcher(timeRange);

    if (timestampMatcher.matches()) {
        final String leftEndpoint = timestampMatcher.group(1);
        lReturn[0] = ("".equals(leftEndpoint)) ? 0 : Long.parseLong(leftEndpoint);

        final String rightEndpoint = timestampMatcher.group(2);
        lReturn[1] = ("".equals(rightEndpoint)) ? Long.MAX_VALUE : Long.parseLong(rightEndpoint);
    }
    return lReturn;
}