Search in sources :

Example 1 with MINUTES

use of java.time.temporal.ChronoUnit.MINUTES in project phoebus-olog by Olog.

the class TimeParser method parseTemporalAmount.

/**
 * Parse a temporal amount like "1 month 2 days" or "1 day 20 seconds"
 *
 *  <p>Provides either a time-based {@link Duration}
 *  or a calendar based {@link Period}.
 *
 *  <p>A period of "1 months" does not have a well defined
 *  length in time because a months could have 28 to 31 days.
 *  When the user specifies "1 month" we assume that
 *  a time span between the same day in different months
 *  is requested.
 *  As soon as the time span includes a month or year,
 *  a {@link Period} is returned and the smaller units
 *  from hours down are ignored.
 *
 *  <p>For time spans that only include days or less,
 *  a {@link Duration} is used.
 *
 *  @param string Text
 *  @return {@link Duration} or {@link Period}
 */
public static TemporalAmount parseTemporalAmount(final String string) {
    if (NOW.equalsIgnoreCase(string))
        return Duration.ZERO;
    final Matcher timeQuantityUnitsMatcher = timeQuantityUnitsPattern.matcher(string);
    final Map<ChronoUnit, Integer> timeQuantities = new HashMap<>();
    boolean use_period = false;
    while (timeQuantityUnitsMatcher.find()) {
        final double quantity = "".equals(timeQuantityUnitsMatcher.group(1)) ? 1.0 : Double.valueOf(timeQuantityUnitsMatcher.group(1));
        final int full = (int) quantity;
        final double fraction = quantity - full;
        final String unit = timeQuantityUnitsMatcher.group(2).toLowerCase();
        // -> We place fractional amounts in the next finer unit.
        if (unit.startsWith("y")) {
            timeQuantities.put(YEARS, full);
            if (fraction > 0) {
                final int next = (int) (fraction * 12 + 0.5);
                timeQuantities.compute(MONTHS, (u, prev) -> prev == null ? next : prev + next);
            }
            use_period = true;
        } else if (unit.startsWith("mo")) {
            timeQuantities.compute(MONTHS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 4 * 7 + 0.5);
                timeQuantities.compute(DAYS, (u, prev) -> prev == null ? next : prev + next);
            }
            use_period = true;
        } else if (unit.startsWith("w")) {
            timeQuantities.compute(WEEKS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 7 + 0.5);
                timeQuantities.compute(DAYS, (u, prev) -> prev == null ? next : prev + next);
            }
            use_period = true;
        } else if (unit.startsWith("mi")) {
            timeQuantities.compute(MINUTES, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 60 + 0.5);
                timeQuantities.compute(SECONDS, (u, prev) -> prev == null ? next : prev + next);
            }
        } else if (unit.startsWith("h")) {
            timeQuantities.compute(HOURS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 60 + 0.5);
                timeQuantities.compute(MINUTES, (u, prev) -> prev == null ? next : prev + next);
            }
        } else if (unit.startsWith("d")) {
            timeQuantities.compute(DAYS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 24 + 0.5);
                timeQuantities.compute(HOURS, (u, prev) -> prev == null ? next : prev + next);
            }
        } else if (unit.startsWith("s")) {
            timeQuantities.compute(SECONDS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 1000 + 0.5);
                timeQuantities.compute(MILLIS, (u, prev) -> prev == null ? next : prev + next);
            }
        } else if (unit.equals("ms")) {
            timeQuantities.compute(MILLIS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 1000 + 0.5);
                timeQuantities.compute(MICROS, (u, prev) -> prev == null ? next : prev + next);
            }
        }
    }
    if (use_period) {
        Period result = Period.ZERO;
        if (timeQuantities.containsKey(YEARS))
            result = result.plusYears(timeQuantities.get(YEARS));
        if (timeQuantities.containsKey(WEEKS))
            result = result.plusDays(7 * timeQuantities.get(WEEKS));
        if (timeQuantities.containsKey(MONTHS))
            result = result.plusMonths(timeQuantities.get(MONTHS));
        if (timeQuantities.containsKey(DAYS))
            result = result.plusDays(timeQuantities.get(DAYS));
        // Ignoring hours, min, .. because they're insignificant compared to weeks
        return result;
    } else {
        Duration result = Duration.ofSeconds(0);
        for (Entry<ChronoUnit, Integer> entry : timeQuantities.entrySet()) result = result.plus(entry.getValue(), entry.getKey());
        return result;
    }
}
Also used : Period(java.time.Period) MONTHS(java.time.temporal.ChronoUnit.MONTHS) SECONDS(java.time.temporal.ChronoUnit.SECONDS) YEARS(java.time.temporal.ChronoUnit.YEARS) HOURS(java.time.temporal.ChronoUnit.HOURS) WEEKS(java.time.temporal.ChronoUnit.WEEKS) HashMap(java.util.HashMap) Instant(java.time.Instant) DAYS(java.time.temporal.ChronoUnit.DAYS) ChronoUnit(java.time.temporal.ChronoUnit) Matcher(java.util.regex.Matcher) MINUTES(java.time.temporal.ChronoUnit.MINUTES) MICROS(java.time.temporal.ChronoUnit.MICROS) Duration(java.time.Duration) Map(java.util.Map) Entry(java.util.Map.Entry) TemporalAmount(java.time.temporal.TemporalAmount) Pattern(java.util.regex.Pattern) MILLIS(java.time.temporal.ChronoUnit.MILLIS) Matcher(java.util.regex.Matcher) HashMap(java.util.HashMap) Period(java.time.Period) Duration(java.time.Duration) ChronoUnit(java.time.temporal.ChronoUnit)

Example 2 with MINUTES

use of java.time.temporal.ChronoUnit.MINUTES in project vertx-starter by vert-x3.

the class AnalyticsTest method projectPersisted.

@Test
void projectPersisted(Vertx vertx, VertxTestContext testContext) {
    Instant createdOn = Instant.now().truncatedTo(MINUTES);
    VertxProject vertxProject = new VertxProject().setId("should-not-persist").setGroupId("should-not-persist").setArtifactId("should-not-persist").setPackageName("should-not-persist").setCreatedOn(createdOn).setOperatingSystem("Other");
    vertx.eventBus().publish(Topics.PROJECT_CREATED, vertxProject);
    Checkpoint checkpoint = testContext.laxCheckpoint();
    vertx.setPeriodic(20, id -> {
        JsonObject query = new JsonObject();
        client.find(AnalyticsService.COLLECTION_NAME, query, testContext.succeeding(list -> {
            testContext.verify(() -> {
                assertTrue(list.size() <= 1);
                if (list.size() == 1) {
                    JsonObject document = list.get(0);
                    assertFalse(Stream.of("id", "groupId", "artifactId", "packageName").anyMatch(document::containsKey));
                    assertEquals(createdOn, document.getJsonObject("createdOn").getInstant("$date"));
                    assertEquals(vertxProject.getOperatingSystem(), document.getString("operatingSystem"));
                    checkpoint.flag();
                    assertTrue(vertx.cancelTimer(id));
                }
            });
        }));
    });
}
Also used : VertxTestContext(io.vertx.junit5.VertxTestContext) BeforeEach(org.junit.jupiter.api.BeforeEach) AnalyticsVerticle(io.vertx.starter.AnalyticsVerticle) Testcontainers(org.testcontainers.junit.jupiter.Testcontainers) Vertx(io.vertx.core.Vertx) MongoClient(io.vertx.ext.mongo.MongoClient) IOException(java.io.IOException) VertxExtension(io.vertx.junit5.VertxExtension) Instant(java.time.Instant) VertxProjectCodec(io.vertx.starter.VertxProjectCodec) MongoDBContainer(org.testcontainers.containers.MongoDBContainer) Test(org.junit.jupiter.api.Test) Topics(io.vertx.starter.config.Topics) AfterEach(org.junit.jupiter.api.AfterEach) Stream(java.util.stream.Stream) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) DeploymentOptions(io.vertx.core.DeploymentOptions) MINUTES(java.time.temporal.ChronoUnit.MINUTES) Assertions(org.junit.jupiter.api.Assertions) JsonObject(io.vertx.core.json.JsonObject) Checkpoint(io.vertx.junit5.Checkpoint) VertxProject(io.vertx.starter.model.VertxProject) Container(org.testcontainers.junit.jupiter.Container) Checkpoint(io.vertx.junit5.Checkpoint) VertxProject(io.vertx.starter.model.VertxProject) Instant(java.time.Instant) JsonObject(io.vertx.core.json.JsonObject) Test(org.junit.jupiter.api.Test)

Example 3 with MINUTES

use of java.time.temporal.ChronoUnit.MINUTES in project phoebus by ControlSystemStudio.

the class TimeParser method parseTemporalAmount.

/**
 * Parse a temporal amount like "1 month 2 days" or "1 day 20 seconds"
 *
 *  <p>Provides either a time-based {@link Duration}
 *  or a calendar based {@link Period}.
 *
 *  <p>A period of "1 months" does not have a well defined
 *  length in time because a months could have 28 to 31 days.
 *  When the user specifies "1 month" we assume that
 *  a time span between the same day in different months
 *  is requested.
 *  As soon as the time span includes a month or year,
 *  a {@link Period} is returned and the smaller units
 *  from hours down are ignored.
 *
 *  <p>For time spans that only include days or less,
 *  a {@link Duration} is used.
 *
 *  @param string Text
 *  @return {@link Duration} or {@link Period}
 */
public static TemporalAmount parseTemporalAmount(final String string) {
    if (NOW.equalsIgnoreCase(string))
        return Duration.ZERO;
    final Matcher timeQuantityUnitsMatcher = timeQuantityUnitsPattern.matcher(string);
    final Map<ChronoUnit, Integer> timeQuantities = new HashMap<>();
    boolean use_period = false;
    while (timeQuantityUnitsMatcher.find()) {
        final double quantity = "".equals(timeQuantityUnitsMatcher.group(1)) ? 1.0 : Double.valueOf(timeQuantityUnitsMatcher.group(1));
        final int full = (int) quantity;
        final double fraction = quantity - full;
        final String unit = timeQuantityUnitsMatcher.group(2).toLowerCase();
        // -> We place fractional amounts in the next finer unit.
        if (unit.startsWith("y")) {
            timeQuantities.put(YEARS, full);
            if (fraction > 0) {
                final int next = (int) (fraction * 12 + 0.5);
                timeQuantities.compute(MONTHS, (u, prev) -> prev == null ? next : prev + next);
            }
            use_period = true;
        } else if (unit.startsWith("mo")) {
            timeQuantities.compute(MONTHS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 4 * 7 + 0.5);
                timeQuantities.compute(DAYS, (u, prev) -> prev == null ? next : prev + next);
            }
            use_period = true;
        } else if (unit.startsWith("w")) {
            timeQuantities.compute(WEEKS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 7 + 0.5);
                timeQuantities.compute(DAYS, (u, prev) -> prev == null ? next : prev + next);
            }
            use_period = true;
        } else if (unit.startsWith("mi")) {
            timeQuantities.compute(MINUTES, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 60 + 0.5);
                timeQuantities.compute(SECONDS, (u, prev) -> prev == null ? next : prev + next);
            }
        } else if (unit.startsWith("h")) {
            timeQuantities.compute(HOURS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 60 + 0.5);
                timeQuantities.compute(MINUTES, (u, prev) -> prev == null ? next : prev + next);
            }
        } else if (unit.startsWith("d")) {
            timeQuantities.compute(DAYS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 24 + 0.5);
                timeQuantities.compute(HOURS, (u, prev) -> prev == null ? next : prev + next);
            }
        } else if (unit.startsWith("s")) {
            timeQuantities.compute(SECONDS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 1000 + 0.5);
                timeQuantities.compute(MILLIS, (u, prev) -> prev == null ? next : prev + next);
            }
        } else if (unit.equals("ms")) {
            timeQuantities.compute(MILLIS, (u, prev) -> prev == null ? full : prev + full);
            if (fraction > 0) {
                final int next = (int) (fraction * 1000 + 0.5);
                timeQuantities.compute(MICROS, (u, prev) -> prev == null ? next : prev + next);
            }
        }
    }
    if (use_period) {
        Period result = Period.ZERO;
        if (timeQuantities.containsKey(YEARS))
            result = result.plusYears(timeQuantities.get(YEARS));
        if (timeQuantities.containsKey(WEEKS))
            result = result.plusDays(7 * timeQuantities.get(WEEKS));
        if (timeQuantities.containsKey(MONTHS))
            result = result.plusMonths(timeQuantities.get(MONTHS));
        if (timeQuantities.containsKey(DAYS))
            result = result.plusDays(timeQuantities.get(DAYS));
        // Ignoring hours, min, .. because they're insignificant compared to weeks
        return result;
    } else {
        Duration result = Duration.ofSeconds(0);
        for (Entry<ChronoUnit, Integer> entry : timeQuantities.entrySet()) result = result.plus(entry.getValue(), entry.getKey());
        return result;
    }
}
Also used : Period(java.time.Period) MONTHS(java.time.temporal.ChronoUnit.MONTHS) SECONDS(java.time.temporal.ChronoUnit.SECONDS) YEARS(java.time.temporal.ChronoUnit.YEARS) HOURS(java.time.temporal.ChronoUnit.HOURS) TimeZone(java.util.TimeZone) WEEKS(java.time.temporal.ChronoUnit.WEEKS) LocalDateTime(java.time.LocalDateTime) HashMap(java.util.HashMap) Instant(java.time.Instant) DAYS(java.time.temporal.ChronoUnit.DAYS) ChronoUnit(java.time.temporal.ChronoUnit) Matcher(java.util.regex.Matcher) MINUTES(java.time.temporal.ChronoUnit.MINUTES) MICROS(java.time.temporal.ChronoUnit.MICROS) Duration(java.time.Duration) DateTimeFormatter(java.time.format.DateTimeFormatter) Map(java.util.Map) Entry(java.util.Map.Entry) TemporalAmount(java.time.temporal.TemporalAmount) Pattern(java.util.regex.Pattern) MILLIS(java.time.temporal.ChronoUnit.MILLIS) Matcher(java.util.regex.Matcher) HashMap(java.util.HashMap) Period(java.time.Period) Duration(java.time.Duration) ChronoUnit(java.time.temporal.ChronoUnit)

Example 4 with MINUTES

use of java.time.temporal.ChronoUnit.MINUTES in project flux-capacitor-client by flux-capacitor-io.

the class SchedulingInterceptor method interceptHandling.

@Override
public Function<DeserializingMessage, Object> interceptHandling(Function<DeserializingMessage, Object> function, Handler<DeserializingMessage> handler, String consumer) {
    return m -> {
        if (m.getMessageType() == MessageType.SCHEDULE) {
            long deadline = millisFromIndex(m.getIndex());
            Periodic periodic = Optional.ofNullable(handler.getMethod(m)).map(method -> method.getAnnotation(Periodic.class)).orElse(ReflectionUtils.getTypeAnnotation(m.getPayloadClass(), Periodic.class));
            Object result;
            Instant now = ofEpochMilli(deadline);
            try {
                result = function.apply(m);
            } catch (Exception e) {
                if (periodic != null && periodic.continueOnError()) {
                    reschedule(m, now.plusMillis(periodic.value()));
                }
                throw e;
            }
            if (result instanceof TemporalAmount) {
                reschedule(m, now.plus((TemporalAmount) result));
            } else if (result instanceof TemporalAccessor) {
                reschedule(m, Instant.from((TemporalAccessor) result));
            } else if (result instanceof Schedule) {
                Schedule schedule = (Schedule) result;
                reschedule(schedule.getPayload(), schedule.getMetadata(), schedule.getDeadline());
            } else if (result != null) {
                Metadata metadata = m.getMetadata();
                Object nextPayload = result;
                if (result instanceof Message) {
                    metadata = ((Message) result).getMetadata();
                    nextPayload = ((Message) result).getPayload();
                }
                if (nextPayload != null && m.getPayloadClass().isAssignableFrom(nextPayload.getClass())) {
                    if (periodic == null) {
                        Instant dispatched = m.getTimestamp();
                        Duration previousDelay = between(dispatched, now);
                        if (previousDelay.compareTo(Duration.ZERO) > 0) {
                            reschedule(nextPayload, metadata, now.plus(previousDelay));
                        } else {
                            log.info("Delay between the time this schedule was created and scheduled is <= 0, " + "rescheduling with delay of 1 minute");
                            reschedule(nextPayload, metadata, now.plus(Duration.of(1, MINUTES)));
                        }
                    } else {
                        reschedule(nextPayload, metadata, now.plusMillis(periodic.value()));
                    }
                } else if (periodic != null) {
                    reschedule(m, now.plusMillis(periodic.value()));
                }
            } else if (periodic != null) {
                reschedule(m, now.plusMillis(periodic.value()));
            }
            return result;
        }
        return function.apply(m);
    };
}
Also used : MessageType(io.fluxcapacitor.common.MessageType) Metadata(io.fluxcapacitor.common.api.Metadata) Function(java.util.function.Function) TemporalAccessor(java.time.temporal.TemporalAccessor) DispatchInterceptor(io.fluxcapacitor.javaclient.publishing.DispatchInterceptor) Instant.ofEpochMilli(java.time.Instant.ofEpochMilli) MINUTES(java.time.temporal.ChronoUnit.MINUTES) Duration(java.time.Duration) Handler(io.fluxcapacitor.common.handling.Handler) TemporalAmount(java.time.temporal.TemporalAmount) DeserializingMessage(io.fluxcapacitor.javaclient.common.serialization.DeserializingMessage) HandleSchedule(io.fluxcapacitor.javaclient.tracking.handling.HandleSchedule) Method(java.lang.reflect.Method) ReflectionUtils.getAnnotatedMethods(io.fluxcapacitor.common.reflection.ReflectionUtils.getAnnotatedMethods) ReflectionUtils(io.fluxcapacitor.common.reflection.ReflectionUtils) Instant(java.time.Instant) String.format(java.lang.String.format) Duration.between(java.time.Duration.between) HandlerInterceptor(io.fluxcapacitor.javaclient.tracking.handling.HandlerInterceptor) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) ReflectionUtils.ensureAccessible(io.fluxcapacitor.common.reflection.ReflectionUtils.ensureAccessible) Clock(java.time.Clock) Optional(java.util.Optional) Message(io.fluxcapacitor.javaclient.common.Message) FluxCapacitor(io.fluxcapacitor.javaclient.FluxCapacitor) IndexUtils.millisFromIndex(io.fluxcapacitor.javaclient.tracking.IndexUtils.millisFromIndex) TemporalAccessor(java.time.temporal.TemporalAccessor) DeserializingMessage(io.fluxcapacitor.javaclient.common.serialization.DeserializingMessage) Message(io.fluxcapacitor.javaclient.common.Message) Instant(java.time.Instant) TemporalAmount(java.time.temporal.TemporalAmount) HandleSchedule(io.fluxcapacitor.javaclient.tracking.handling.HandleSchedule) Metadata(io.fluxcapacitor.common.api.Metadata) Duration(java.time.Duration)

Example 5 with MINUTES

use of java.time.temporal.ChronoUnit.MINUTES in project trino by trinodb.

the class TestDeltaLakePageSink method testPageSinkStats.

@Test
public void testPageSinkStats() throws Exception {
    File tempDir = Files.createTempDir();
    try {
        DeltaLakeWriterStats stats = new DeltaLakeWriterStats();
        String tablePath = tempDir.getAbsolutePath() + "/test_table";
        ConnectorPageSink pageSink = createPageSink(new Path(tablePath), stats);
        List<LineItemColumn> columns = ImmutableList.copyOf(LineItemColumn.values());
        List<Type> columnTypes = columns.stream().map(LineItemColumn::getType).map(TestDeltaLakePageSink::getTrinoType).collect(toList());
        PageBuilder pageBuilder = new PageBuilder(columnTypes);
        long rows = 0;
        for (LineItem lineItem : new LineItemGenerator(0.01, 1, 1)) {
            if (rows >= NUM_ROWS) {
                break;
            }
            rows++;
            pageBuilder.declarePosition();
            for (int i = 0; i < columns.size(); i++) {
                LineItemColumn column = columns.get(i);
                BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(i);
                writeToBlock(blockBuilder, column, lineItem);
            }
        }
        Page page = pageBuilder.build();
        pageSink.appendPage(page);
        JsonCodec<DataFileInfo> dataFileInfoCodec = new JsonCodecFactory().jsonCodec(DataFileInfo.class);
        Collection<Slice> fragments = getFutureValue(pageSink.finish());
        List<DataFileInfo> dataFileInfos = fragments.stream().map(Slice::getBytes).map(dataFileInfoCodec::fromJson).collect(toImmutableList());
        assertEquals(dataFileInfos.size(), 1);
        DataFileInfo dataFileInfo = dataFileInfos.get(0);
        List<File> files = ImmutableList.copyOf(new File(tablePath).listFiles((dir, name) -> !name.endsWith(".crc")));
        assertEquals(files.size(), 1);
        File outputFile = files.get(0);
        assertEquals(round(stats.getInputPageSizeInBytes().getAllTime().getMax()), page.getRetainedSizeInBytes());
        assertEquals(dataFileInfo.getStatistics().getNumRecords(), Optional.of(rows));
        assertEquals(dataFileInfo.getPartitionValues(), ImmutableList.of());
        assertEquals(dataFileInfo.getSize(), outputFile.length());
        assertEquals(dataFileInfo.getPath(), outputFile.getName());
        Instant now = Instant.now();
        assertTrue(dataFileInfo.getCreationTime() < now.toEpochMilli());
        assertTrue(dataFileInfo.getCreationTime() > now.minus(1, MINUTES).toEpochMilli());
    } finally {
        deleteRecursively(tempDir.toPath(), ALLOW_INSECURE);
    }
}
Also used : Slice(io.airlift.slice.Slice) PageBuilder(io.trino.spi.PageBuilder) MoreFiles.deleteRecursively(com.google.common.io.MoreFiles.deleteRecursively) Type(io.trino.spi.type.Type) Page(io.trino.spi.Page) VarcharType.createUnboundedVarcharType(io.trino.spi.type.VarcharType.createUnboundedVarcharType) Test(org.testng.annotations.Test) TypeOperators(io.trino.spi.type.TypeOperators) JoinCompiler(io.trino.sql.gen.JoinCompiler) GroupByHashPageIndexerFactory(io.trino.operator.GroupByHashPageIndexerFactory) TpchColumnType(io.trino.tpch.TpchColumnType) ALLOW_INSECURE(com.google.common.io.RecursiveDeleteOption.ALLOW_INSECURE) ImmutableList(com.google.common.collect.ImmutableList) Files(com.google.common.io.Files) NodeVersion(io.trino.plugin.hive.NodeVersion) MINUTES(java.time.temporal.ChronoUnit.MINUTES) Math.round(java.lang.Math.round) Slices(io.airlift.slice.Slices) Path(org.apache.hadoop.fs.Path) LineItemColumn(io.trino.tpch.LineItemColumn) INTEGER(io.trino.spi.type.IntegerType.INTEGER) Assert.assertEquals(io.trino.testing.assertions.Assert.assertEquals) ConnectorPageSink(io.trino.spi.connector.ConnectorPageSink) BlockTypeOperators(io.trino.type.BlockTypeOperators) Collection(java.util.Collection) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) TestingTypeManager(io.trino.spi.type.TestingTypeManager) Instant(java.time.Instant) MoreFutures.getFutureValue(io.airlift.concurrent.MoreFutures.getFutureValue) HDFS_ENVIRONMENT(io.trino.plugin.hive.HiveTestUtils.HDFS_ENVIRONMENT) File(java.io.File) LineItemGenerator(io.trino.tpch.LineItemGenerator) DOUBLE(io.trino.spi.type.DoubleType.DOUBLE) LineItem(io.trino.tpch.LineItem) SESSION(io.trino.plugin.hive.HiveTestUtils.SESSION) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) BIGINT(io.trino.spi.type.BigintType.BIGINT) JsonCodecFactory(io.airlift.json.JsonCodecFactory) Optional(java.util.Optional) Assert.assertTrue(org.testng.Assert.assertTrue) BlockBuilder(io.trino.spi.block.BlockBuilder) HiveTransactionHandle(io.trino.plugin.hive.HiveTransactionHandle) REGULAR(io.trino.plugin.deltalake.DeltaLakeColumnType.REGULAR) DATE(io.trino.spi.type.DateType.DATE) JsonCodec(io.airlift.json.JsonCodec) Page(io.trino.spi.Page) PageBuilder(io.trino.spi.PageBuilder) BlockBuilder(io.trino.spi.block.BlockBuilder) Path(org.apache.hadoop.fs.Path) LineItemColumn(io.trino.tpch.LineItemColumn) Instant(java.time.Instant) LineItem(io.trino.tpch.LineItem) Type(io.trino.spi.type.Type) VarcharType.createUnboundedVarcharType(io.trino.spi.type.VarcharType.createUnboundedVarcharType) TpchColumnType(io.trino.tpch.TpchColumnType) Slice(io.airlift.slice.Slice) ConnectorPageSink(io.trino.spi.connector.ConnectorPageSink) File(java.io.File) JsonCodecFactory(io.airlift.json.JsonCodecFactory) LineItemGenerator(io.trino.tpch.LineItemGenerator) Test(org.testng.annotations.Test)

Aggregations

Instant (java.time.Instant)5 MINUTES (java.time.temporal.ChronoUnit.MINUTES)5 Duration (java.time.Duration)3 TemporalAmount (java.time.temporal.TemporalAmount)3 List (java.util.List)2 Optional (java.util.Optional)2 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1 Files (com.google.common.io.Files)1 MoreFiles.deleteRecursively (com.google.common.io.MoreFiles.deleteRecursively)1 ALLOW_INSECURE (com.google.common.io.RecursiveDeleteOption.ALLOW_INSECURE)1 MoreFutures.getFutureValue (io.airlift.concurrent.MoreFutures.getFutureValue)1 JsonCodec (io.airlift.json.JsonCodec)1 JsonCodecFactory (io.airlift.json.JsonCodecFactory)1 Slice (io.airlift.slice.Slice)1 Slices (io.airlift.slice.Slices)1 MessageType (io.fluxcapacitor.common.MessageType)1 Metadata (io.fluxcapacitor.common.api.Metadata)1 Handler (io.fluxcapacitor.common.handling.Handler)1 ReflectionUtils (io.fluxcapacitor.common.reflection.ReflectionUtils)1