Skip to content

Commit c50d9a6

Browse files
authored
Prepare for v2.0.0 release and update README + add migration guide (#145)
## Problem Prepare to release v2.0.0 ## Solution To release v2.0.0: 1. add migration guide 2. update SDK version# 3. update README 4. update CHANGELOG ## Type of Change - [X] Non-code change (docs, etc) ## Test Plan NA
1 parent ebb0fc9 commit c50d9a6

File tree

6 files changed

+157
-22
lines changed

6 files changed

+157
-22
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
[comment]: <> (When bumping [pc:VERSION_LATEST_RELEASE] create a new entry below)
44
### Unreleased version
5+
### 2.0.0
6+
- Add deletion protection
7+
58
### 1.2.2
69
- Add support for proxy configuration
710
- Fix user-agent for grpc

README.md

Lines changed: 59 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Maven:
1515
<dependency>
1616
<groupId>io.pinecone</groupId>
1717
<artifactId>pinecone-client</artifactId>
18-
<version>1.2.2</version>
18+
<version>2.0.0</version>
1919
</dependency>
2020
```
2121

@@ -28,8 +28,8 @@ implementation "io.pinecone:pinecone-client:1.2.2"
2828

2929
[comment]: <> (^ [pc:VERSION_LATEST_RELEASE])
3030

31-
Alternatively, you can use our standalone uberjar [pinecone-client-1.2.2-all.jar](https://repo1.maven.org/maven2/io/pinecone/pinecone-client/1.2.2/pinecone-client-1.2.2-all.jar), which bundles the pinecone
32-
client and all dependencies together. You can include this in your classpath like you do with any 3rd party JAR without
31+
Alternatively, you can use our standalone uberjar [pinecone-client-2.0.0-all.jar](https://repo1.maven.org/maven2/io/pinecone/pinecone-client/2.0.0/pinecone-client-2.0.0-all.jar), which bundles the pinecone
32+
client and all dependencies together. You can include this in your classpath like you do with any 3rd party JAR without
3333
having to obtain the *pinecone-client* dependencies separately.
3434

3535
[comment]: <> (^ [pc:VERSION_LATEST_RELEASE])
@@ -94,19 +94,17 @@ serverless and regional availability, see [Understanding indexes](https://docs.p
9494
import io.pinecone.clients.Pinecone;
9595
import org.openapitools.client.model.IndexModel;
9696

97-
public class CreateServerlessIndexExample {
98-
public static void main(String[] args) {
99-
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
97+
...
98+
99+
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
100100

101-
String indexName = "example-index";
102-
String similarityMetric = "cosine";
103-
int dimension = 1538;
104-
String cloud = "aws";
105-
String region = "us-west-2";
101+
String indexName = "example-index";
102+
String similarityMetric = "cosine";
103+
int dimension = 1538;
104+
String cloud = "aws";
105+
String region = "us-west-2";
106106

107-
IndexModel indexModel = pinecone.createServerlessIndex(indexName, similarityMetric, dimension, cloud, region);
108-
}
109-
}
107+
IndexModel indexModel = pinecone.createServerlessIndex(indexName, similarityMetric, dimension, cloud, region, DeletionProtection.ENABLED);
110108
```
111109

112110
### Create a pod index
@@ -129,6 +127,26 @@ String podType = "p1.x1";
129127
IndexModel indexModel = pinecone.createPodsIndex(indexName, dimension, environment, podType, similarityMetric);
130128
```
131129

130+
### Create a pod index with deletion protection enabled
131+
The following is an example of creating a pod-based index with deletion protection enabled. For all the possible
132+
configuration options, see `main/java/io/pinecone/clients/Pinecone.java`.
133+
134+
```java
135+
import io.pinecone.clients.Pinecone;
136+
import org.openapitools.client.model.IndexModel;
137+
...
138+
139+
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
140+
141+
String indexName = "example-index";
142+
int dimension = 1538;
143+
String environment = "us-east-1-aws";
144+
String podType = "p1.x1";
145+
146+
IndexModel indexModel = pinecone.createPodsIndex(indexName, dimension, environment, podType, DeletionProtection.ENABLED);
147+
```
148+
149+
132150
## List indexes
133151

134152
The following example returns all indexes (and their corresponding metadata) in your project.
@@ -183,7 +201,33 @@ String indexName = "example-index";
183201
String podType = "p1.x1";
184202
int newNumberOfReplicas = 7;
185203

186-
pinecone.configureIndex(indexName, podType, newNumberOfReplicas);
204+
pinecone.configurePodsIndex(indexName, podType, newNumberOfReplicas);
205+
```
206+
207+
## Enable deletion protection for pod index
208+
209+
The following example enables deletion protection of a pod-based index.
210+
211+
```java
212+
import io.pinecone.clients.Pinecone;
213+
...
214+
215+
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
216+
217+
pinecone.configurePodsIndex(indexName, DeletionProtection.ENABLED);
218+
```
219+
220+
## Enable deletion protection for serverless index
221+
222+
The following example enables deletion protection of a serverless index.
223+
224+
```java
225+
import io.pinecone.clients.Pinecone;
226+
...
227+
228+
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
229+
230+
pinecone.configureServerlessIndex(indexName, DeletionProtection.ENABLED);
187231
```
188232

189233
## Describe index statistics
@@ -206,10 +250,6 @@ DescribeIndexStatsResponse indexStatsResponse = index.describeIndexStats();
206250
Operations related to the indexing, deleting, and querying of vectors are called [data plane](https://docs.pinecone.io/reference/api/introduction#data-plane)
207251
operations.
208252

209-
210-
211-
212-
213253
The following example upserts vectors to `example-index`.
214254

215255
```java

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pineconeClientVersion = 1.2.2
1+
pineconeClientVersion = 2.0.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package io.pinecone.commons;
22

33
public class Constants {
4-
public static final String pineconeClientVersion = "v1.2.2";
4+
public static final String pineconeClientVersion = "v2.0.0";
55
}

v1-migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ controlPlaneClient.createIndex(createIndexRequest);
9797

9898
**After: ≥ 1.0.0**
9999

100-
```python
100+
```java
101101
import io.pinecone.clients.Pinecone;
102102
import org.openapitools.client.model.IndexModel;
103103
...

v2-migration.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Java SDK v2.0.0 Migration Guide
2+
3+
This migration guide is specific to migrating from versions "**v1.0.x**" and below to "**v2.0.x**".
4+
5+
## Changes overview
6+
7+
- Added deletion protection feature which will impact the following existing methods:
8+
- `createServerlessIndex()` is now accepted a new argument: Enum `DeletionProtection`
9+
- Renamed `configureIndex()` to `configurePodsIndex()`
10+
11+
## Indexes
12+
13+
### Creating a serverless index
14+
Added enum `DeletionProtection` as an argument
15+
16+
**Before: ≤ 1.2.2**
17+
18+
```java
19+
import io.pinecone.clients.Pinecone;
20+
import org.openapitools.client.model.IndexModel;
21+
...
22+
23+
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
24+
25+
String indexName = "example-index";
26+
String similarityMetric = "cosine";
27+
int dimension = 1538;
28+
String cloud = "aws";
29+
String region = "us-west-2";
30+
31+
IndexModel indexModel = pinecone.createServerlessIndex(indexName,
32+
similarityMetric,
33+
dimension,
34+
cloud,
35+
region);
36+
```
37+
38+
**After: ≥ 2.0.0**
39+
40+
```java
41+
import io.pinecone.clients.Pinecone;
42+
import org.openapitools.client.model.IndexModel;
43+
...
44+
45+
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
46+
47+
String indexName = "example-index";
48+
String similarityMetric = "cosine";
49+
int dimension = 1538;
50+
String cloud = "aws";
51+
String region = "us-west-2";
52+
53+
IndexModel indexModel = pinecone.createServerlessIndex(indexName,
54+
similarityMetric,
55+
dimension,
56+
cloud,
57+
region,
58+
DeletionProtection.ENABLED);
59+
```
60+
61+
## Configuring indexes
62+
Renamed `configureIndex()` to `configurePodsIndex()`
63+
64+
**Before: ≤ 1.2.2**
65+
66+
```java
67+
import io.pinecone.clients.Pinecone;
68+
...
69+
70+
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
71+
72+
String indexName = "my-index";
73+
String podType = "p1.x1";
74+
int newNumberOfReplicas = 7;
75+
76+
pinecone.configureIndex(indexName, podType, newNumberOfReplicas);
77+
```
78+
79+
**After: ≥ 2.0.0**
80+
81+
```java
82+
import io.pinecone.clients.Pinecone;
83+
...
84+
85+
Pinecone pinecone = new Pinecone.Builder("PINECONE_API_KEY").build();
86+
87+
String indexName = "my-index";
88+
String podType = "p1.x1";
89+
int newNumberOfReplicas = 7;
90+
91+
pinecone.configurePodsIndex(indexName, podType, newNumberOfReplicas);
92+
```

0 commit comments

Comments
 (0)