Tabnine Logo
PartitionSchema.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.kudu.client.PartitionSchema
constructor

Best Java code snippets using org.apache.kudu.client.PartitionSchema.<init> (Showing top 3 results out of 315)

origin: org.apache.kudu/kudu-client

/**
 * Builds the default partition schema for a schema.
 * @param schema the schema
 * @return a default partition schema
 */
private PartitionSchema defaultPartitionSchema(Schema schema) {
 List<Integer> columnIds = new ArrayList<>();
 for (int i = 0; i < schema.getPrimaryKeyColumnCount(); i++) {
  // Schema does not provide a way to lookup a column ID by column index,
  // so instead we assume that the IDs for the primary key columns match
  // their respective index, which holds up when the schema is created
  // with buildSchema.
  columnIds.add(i);
 }
 return new PartitionSchema(
   new PartitionSchema.RangeSchema(columnIds),
   ImmutableList.<PartitionSchema.HashBucketSchema>of(), schema);
}
origin: org.apache.kudu/kudu-client

/**
 * Factory method for creating a {@code PartitionSchema} from a protobuf message.
 *
 * @param pb the partition schema protobuf message
 * @return a partition instance
 */
static PartitionSchema pbToPartitionSchema(Common.PartitionSchemaPB pb, Schema schema) {
 List<Integer> rangeColumns = pbToIds(pb.getRangeSchema().getColumnsList());
 PartitionSchema.RangeSchema rangeSchema = new PartitionSchema.RangeSchema(rangeColumns);
 ImmutableList.Builder<PartitionSchema.HashBucketSchema> hashSchemas = ImmutableList.builder();
 for (Common.PartitionSchemaPB.HashBucketSchemaPB hashBucketSchemaPB
   : pb.getHashBucketSchemasList()) {
  List<Integer> hashColumnIds = pbToIds(hashBucketSchemaPB.getColumnsList());
  PartitionSchema.HashBucketSchema hashSchema =
    new PartitionSchema.HashBucketSchema(hashColumnIds,
                       hashBucketSchemaPB.getNumBuckets(),
                       hashBucketSchemaPB.getSeed());
  hashSchemas.add(hashSchema);
 }
 return new PartitionSchema(rangeSchema, hashSchemas.build(), schema);
}
origin: org.apache.kudu/kudu-client

new PartitionSchema(new RangeSchema(ImmutableList.of(0, 1, 2)),
          ImmutableList.of(
            new HashBucketSchema(ImmutableList.of(0, 1), 32, 0),
org.apache.kudu.clientPartitionSchema<init>

Javadoc

Creates a new partition schema from the range and hash bucket schemas.

Popular methods of PartitionSchema

  • getHashBucketSchemas
  • getRangeSchema
  • isSimpleRangePartitioning
    Returns true if the partition schema if the partition schema does not include any hash components, a
  • encodePartitionKey
    Returns the encoded partition key of the row.

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • getExternalFilesDir (Context)
  • startActivity (Activity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now