Skip to content

Conversation

@rohanshah18
Copy link
Contributor

Problem

Add Support for Dedicated Read Capacity (DRN) and Metadata Schema Configuration

Solution

This PR adds support for Dedicated Read Capacity (DRN) and Metadata Schema Configuration for serverless indexes. These features allow users to:

  1. Configure dedicated read nodes for better performance and cost predictability
  2. Limit metadata indexing to specific fields for improved performance
  3. Configure read capacity on existing serverless indexes

1. Create Serverless Index with Read Capacity and Schema

Added overloaded createServerlessIndex method that accepts:

  • ReadCapacity parameter for configuring OnDemand or Dedicated read capacity
  • BackupModelSchema parameter for configuring metadata schema
// Create index with Dedicated read capacity
ScalingConfigManual manual = new ScalingConfigManual().shards(2).replicas(2);
ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig()
    .nodeType("t1")
    .scaling("Manual")
    .manual(manual);
ReadCapacity readCapacity = new ReadCapacity(
    new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated));

IndexModel indexModel = pinecone.createServerlessIndex(
    indexName, "cosine", 1536, "aws", "us-west-2", 
    "enabled", tags, readCapacity, null);

// Create index with metadata schema
Map<String, BackupModelSchemaFieldsValue> fields = new HashMap<>();
fields.put("genre", new BackupModelSchemaFieldsValue().filterable(true));
fields.put("year", new BackupModelSchemaFieldsValue().filterable(true));
BackupModelSchema schema = new BackupModelSchema().fields(fields);

IndexModel indexModel = pinecone.createServerlessIndex(
    indexName, "cosine", 1536, "aws", "us-west-2", 
    "enabled", tags, null, schema);

2. Create Index for Model with Read Capacity and Schema

Added overloaded createIndexForModel method that accepts:

  • ReadCapacity parameter
  • BackupModelSchema parameter

3. Configure Read Capacity on Existing Index

Enhanced configureServerlessIndex method to accept flattened parameters for easier use:

// Switch to Dedicated read capacity
IndexModel indexModel = pinecone.configureServerlessIndex(
    indexName, "enabled", tags, null, "Dedicated", "t1", 2, 2);

// Switch to OnDemand read capacity
IndexModel indexModel = pinecone.configureServerlessIndex(
    indexName, "enabled", tags, null, "OnDemand", null, null, null);

Note: Read capacity settings can only be updated once per hour per index.

Documentation

  • Updated README.md with examples for:
    • Creating serverless indexes with dedicated read capacity
    • Creating serverless indexes with OnDemand read capacity
    • Creating serverless indexes with metadata schema
    • Configuring read capacity on existing indexes

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

  • Added comprehensive integration tests in ReadCapacityAndSchemaTest.java:

    • Create serverless index with OnDemand read capacity
    • Create serverless index with Dedicated read capacity
    • Create serverless index with metadata schema
    • Create serverless index with both read capacity and schema
    • Create index for model with read capacity and schema
    • Configure read capacity on existing index
  • Added helper method waitUntilReadCapacityIsReady() in TestUtilities.java to wait for read capacity status to be "Ready" before configuring (required by API).

  • Note: Tests for switching read capacity modes and scaling are omitted due to API rate limits (once per hour per index).

@rohanshah18 rohanshah18 changed the base branch from main to rshah/release-candidate/2025-10 November 6, 2025 16:18
@rohanshah18 rohanshah18 marked this pull request as ready for review November 6, 2025 18:32
@rohanshah18 rohanshah18 merged commit f15f541 into rshah/release-candidate/2025-10 Nov 7, 2025
9 checks passed
@rohanshah18 rohanshah18 deleted the rshah/drn branch November 7, 2025 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants