com.facebook.presto.spi.session.PropertyMetadata Java Examples

The following examples show how to use com.facebook.presto.spi.session.PropertyMetadata. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KinesisConnector.java    From presto-kinesis with Apache License 2.0 6 votes vote down vote up
/** Build the list of session properties we support to supply them to Presto. */
protected void buildPropertyList()
{
    KinesisConnectorConfig cfg = this.metadata.getConnectorConfig();

    this.propertyList.add(PropertyMetadata.booleanProperty(
            SessionVariables.CHECKPOINT_ENABLED, "Are checkpoints used in this session?", cfg.isCheckpointEnabled(), false));
    this.propertyList.add(PropertyMetadata.integerProperty(
            SessionVariables.ITERATION_NUMBER, "checkpoint iteration number", cfg.getIterationNumber(), false));
    this.propertyList.add(PropertyMetadata.stringProperty(
            SessionVariables.CHECKPOINT_LOGICAL_NAME, "checkpoint logical name", cfg.getLogicalProcessName(), false));

    this.propertyList.add(PropertyMetadata.integerProperty(
            SessionVariables.MAX_BATCHES, "max number of calls to Kinesis per query", cfg.getMaxBatches(), false));
    this.propertyList.add(PropertyMetadata.integerProperty(
            SessionVariables.BATCH_SIZE, "Record limit in calls to Kinesis", cfg.getBatchSize(), false));
    this.propertyList.add(PropertyMetadata.booleanProperty(
            SessionVariables.ITER_FROM_TIMESTAMP, "Start from timestamp not trim horizon", cfg.isIterFromTimestamp(), false));
    this.propertyList.add(PropertyMetadata.longProperty(
            SessionVariables.ITER_OFFSET_SECONDS, "Seconds before current time to start iterator", cfg.getIterOffsetSeconds(), false));
    // This does not have a corresponding configuration setting, since when not set we can use ITER_OFFSET_SECONDS
    this.propertyList.add(PropertyMetadata.stringProperty(
            SessionVariables.ITER_START_TIMESTAMP, "Timestamp in Presto format to start iterator", SessionVariables.UNSET_TIMESTAMP, false));
}
 
Example #2
Source File: HbaseTableProperties.java    From presto-connectors with Apache License 2.0 5 votes vote down vote up
public HbaseTableProperties()
{
    PropertyMetadata<String> s1 = stringProperty(
            COLUMN_MAPPING,
            "Comma-delimited list of column metadata: col_name:col_family:col_qualifier,[...]. Required for external tables. Not setting this property results in auto-generated column names.",
            null,
            false);

    PropertyMetadata<String> s2 = stringProperty(
            INDEX_COLUMNS,
            "A comma-delimited list of Presto columns that are indexed in this table's corresponding index table. Default is no indexed columns.",
            "",
            false);

    PropertyMetadata<Boolean> s3 = booleanProperty(
            EXTERNAL,
            "If true, Presto will only do metadata operations for the table. Else, Presto will create and drop Hbase tables where appropriate. Default false.",
            false,
            false);

    PropertyMetadata<String> s4 = stringProperty(
            LOCALITY_GROUPS,
            "List of locality groups to set on the Hbase table. Only valid on internal tables. String format is locality group name, colon, comma delimited list of Presto column names in the group. Groups are delimited by pipes. Example: group1:colA,colB,colC|group2:colD,colE,colF|etc.... Default is no locality groups.",
            null,
            false);

    PropertyMetadata<String> s5 = stringProperty(
            ROW_ID,
            "Presto column name that maps to the Hbase row ID. Default is the first column.",
            null,
            false);

    PropertyMetadata<String> s6 = stringProperty(
            SCAN_AUTHS,
            "Scan-time authorizations set on the batch scanner. Default is all scan authorizations for the user",
            null,
            false);

    tableProperties = ImmutableList.of(s1, s2, s3, s4, s5, s6);
}
 
Example #3
Source File: KuduTableProperties.java    From presto-kudu with Apache License 2.0 5 votes vote down vote up
public KuduTableProperties() {
    PropertyMetadata<String> s1 = stringProperty(
            COLUMN_DESIGN,
            "Kudu-specific column design (key, encoding, and compression) as JSON, like {\"column1\": {\"key\": true, \"encoding\": \"dictionary\", \"compression\": \"LZ4\"}, \"column2\": {...}}",
            null,
            false);

    PropertyMetadata<String> s2 = stringProperty(
            PARTITION_DESIGN,
            "Partition design (hash partition(s) and/or range partition) as JSON.",
            null,
            false);

    PropertyMetadata<Integer> s3 = integerProperty(
            NUM_REPLICAS,
            "Number of tablet replicas. Default 3.",
            3,
            false);

    PropertyMetadata<String> s4 = stringProperty(
            RANGE_PARTITIONS,
            "Initial range partitions as JSON",
            null,
            false);

    tableProperties = ImmutableList.of(s1, s2, s3, s4);
}
 
Example #4
Source File: KinesisConnector.java    From presto-kinesis with Apache License 2.0 5 votes vote down vote up
@Inject
public KinesisConnector(
        KinesisMetadata metadata,
        KinesisSplitManager splitManager,
        KinesisRecordSetProvider recordSetProvider)
{
    this.metadata = checkNotNull(metadata, "metadata is null");
    this.splitManager = checkNotNull(splitManager, "splitManager is null");
    this.recordSetProvider = checkNotNull(recordSetProvider, "recordSetProvider is null");

    this.propertyList = new ArrayList<PropertyMetadata<?>>();
    buildPropertyList();

    this.shutdownObjects = new ArrayList<ConnectorShutdown>();
}
 
Example #5
Source File: ElasticsearchConnector.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
@Override
public List<PropertyMetadata<?>> getSessionProperties()
{
    return sessionProperties.getSessionProperties();
}
 
Example #6
Source File: ElasticsearchSessionProperties.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
public List<PropertyMetadata<?>> getSessionProperties()
{
    return sessionProperties;
}
 
Example #7
Source File: HbaseConnector.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
@Override
public List<PropertyMetadata<?>> getTableProperties()
{
    return tableProperties.getTableProperties();
}
 
Example #8
Source File: HbaseConnector.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
@Override
public List<PropertyMetadata<?>> getSessionProperties()
{
    return sessionProperties.getSessionProperties();
}
 
Example #9
Source File: HbaseTableProperties.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
public List<PropertyMetadata<?>> getTableProperties()
{
    return tableProperties;
}
 
Example #10
Source File: HbaseSessionProperties.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
@Inject
public HbaseSessionProperties()
{
    PropertyMetadata<Boolean> s1 = booleanProperty(
            OPTIMIZE_LOCALITY_ENABLED,
            "Set to true to enable data locality for non-indexed scans. Default true.", true,
            false);

    PropertyMetadata<Boolean> s2 = booleanProperty(
            OPTIMIZE_SPLIT_RANGES_ENABLED,
            "Set to true to split non-indexed queries by tablet splits. Should generally be true.",
            true, false);

    PropertyMetadata<String> s3 = stringProperty(
            SCAN_USERNAME,
            "User to impersonate when scanning the tables. This property trumps the scan_auths table property. Default is the user in the configuration file.", null, false);

    PropertyMetadata<Integer> s4 = integerProperty(
            SCAN_BATCH_SIZE,
            "Set the maximum number of values to return for each call to next(). Default 100.",
            100,
            false);

    PropertyMetadata<Integer> s5 = integerProperty(
            SCAN_CACHING,
            "Set the number of rows for caching that will be passed to scanners. Default 50.",
            50,
            false);

    PropertyMetadata<Integer> s6 = integerProperty(
            SCAN_MAX_RESULT_SIZE,
            "Set the maximum result size. The default is -1; this means that no specific. The maximum result size in bytes . Default -1.",
            -1,
            false);

    PropertyMetadata<Integer> s7 = integerProperty(
            SCAN_MAX_VERSIONS,
            "Get up to the specified number of versions of each column. Default 1.",
            1,
            false);

    sessionProperties = ImmutableList.of(s1, s2, s3, s4, s5, s6, s7);
}
 
Example #11
Source File: HbaseSessionProperties.java    From presto-connectors with Apache License 2.0 4 votes vote down vote up
public List<PropertyMetadata<?>> getSessionProperties()
{
    return sessionProperties;
}
 
Example #12
Source File: KuduTableProperties.java    From presto-kudu with Apache License 2.0 4 votes vote down vote up
public List<PropertyMetadata<?>> getTableProperties() {
    return tableProperties;
}
 
Example #13
Source File: KuduConnector.java    From presto-kudu with Apache License 2.0 4 votes vote down vote up
@Override
public List<PropertyMetadata<?>> getTableProperties() {
    return tableProperties.getTableProperties();
}
 
Example #14
Source File: KinesisConnector.java    From presto-kinesis with Apache License 2.0 4 votes vote down vote up
/**
 * Return the session properties.
 *
 * @return the system properties for this connector
 */
@Override
public List<PropertyMetadata<?>> getSessionProperties()
{
    return this.propertyList;
}