Class PineconeClient

java.lang.Object
com.hw.pinecone.PineconeClient
All Implemented Interfaces:
Closeable, AutoCloseable

public class PineconeClient extends Object implements Closeable
Because the pinecone-java-client does not support managing Pinecone services, only reading and writing from existing indices. Therefore, this needs to be rewritten.

pinecone-api-doc

Author:
HamaWhite
  • Field Details

    • requestTimeout

      protected long requestTimeout
      Default is 16 seconds.
  • Constructor Details

    • PineconeClient

      public PineconeClient()
  • Method Details

    • init

      public PineconeClient init()
      Initializes the PineconeClient instance.
      Returns:
      the initialized PineconeClient instance
    • indexClient

      public IndexClient indexClient(String name)
    • createRetrofit

      public retrofit2.Retrofit createRetrofit(String baseUrl)
      Initializes the PineconeClient instance.
      Returns:
      the initialized PineconeClient instance
    • defaultObjectMapper

      public static com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper()
    • close

      public void close()
      Closes the HttpClient connection pool.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • listIndexes

      public List<String> listIndexes()
      This operation returns a list of your Pinecone indexes.
      Returns:
      a list of strings representing the Pinecone indexes.
    • createIndex

      public void createIndex(CreateIndexRequest request)
      This operation creates a Pinecone index.
      Parameters:
      request - create index request
    • describeIndex

      public IndexDescription describeIndex(String name)
      Get a description of an index.
      Parameters:
      name - the name of the index
      Returns:
      a description of the index
    • deleteIndex

      public void deleteIndex(String name)
      This operation deletes an existing index.
      Parameters:
      name - the name of the index