Skip to content

Commit

Permalink
[website] rename property to tenant (apache#2326)
Browse files Browse the repository at this point in the history
### Changes

- fix swagger definitions on offloader and compaction
- rename property to tenant across documentations
  • Loading branch information
sijie authored Aug 7, 2018
1 parent 6f6c5c8 commit 15441f8
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -658,104 +658,104 @@ private Policies getDefaultPolicesIfNull(Policies policies) {
}

@GET
@Path("/{property}/{namespace}/compactionThreshold")
@Path("/{tenant}/{namespace}/compactionThreshold")
@ApiOperation(value = "Maximum number of uncompacted bytes in topics before compaction is triggered.",
notes = "The backlog size is compared to the threshold periodically. "
+ "A threshold of 0 disabled automatic compaction")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
public long getCompactionThreshold(@PathParam("property") String property,
public long getCompactionThreshold(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace) {
validateNamespaceName(property, namespace);
validateNamespaceName(tenant, namespace);
return internalGetCompactionThreshold();
}

@PUT
@Path("/{property}/{namespace}/compactionThreshold")
@Path("/{tenant}/{namespace}/compactionThreshold")
@ApiOperation(value = "Set maximum number of uncompacted bytes in a topic before compaction is triggered.",
notes = "The backlog size is compared to the threshold periodically. "
+ "A threshold of 0 disabled automatic compaction")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification"),
@ApiResponse(code = 412, message = "compactionThreshold value is not valid") })
public void setCompactionThreshold(@PathParam("property") String property,
public void setCompactionThreshold(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace,
long newThreshold) {
validateNamespaceName(property, namespace);
validateNamespaceName(tenant, namespace);
internalSetCompactionThreshold(newThreshold);
}

@GET
@Path("/{property}/{namespace}/offloadThreshold")
@Path("/{tenant}/{namespace}/offloadThreshold")
@ApiOperation(value = "Maximum number of bytes stored on the pulsar cluster for a topic,"
+ " before the broker will start offloading to longterm storage",
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
public long getOffloadThreshold(@PathParam("property") String property,
public long getOffloadThreshold(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace) {
validateNamespaceName(property, namespace);
validateNamespaceName(tenant, namespace);
return internalGetOffloadThreshold();
}

@PUT
@Path("/{property}/{namespace}/offloadThreshold")
@Path("/{tenant}/{namespace}/offloadThreshold")
@ApiOperation(value = "Set maximum number of bytes stored on the pulsar cluster for a topic,"
+ " before the broker will start offloading to longterm storage",
notes = "A negative value disables automatic offloading")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification"),
@ApiResponse(code = 412, message = "offloadThreshold value is not valid") })
public void setOffloadThreshold(@PathParam("property") String property,
public void setOffloadThreshold(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace,
long newThreshold) {
validateNamespaceName(property, namespace);
validateNamespaceName(tenant, namespace);
internalSetOffloadThreshold(newThreshold);
}

@GET
@Path("/{property}/{namespace}/offloadDeletionLagMs")
@Path("/{tenant}/{namespace}/offloadDeletionLagMs")
@ApiOperation(value = "Number of milliseconds to wait before deleting a ledger segment which has been offloaded"
+ " from the Pulsar cluster's local storage (i.e. BookKeeper)",
notes = "A negative value denotes that deletion has been completely disabled."
+ " 'null' denotes that the topics in the namespace will fall back to the"
+ " broker default for deletion lag.")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist") })
public Long getOffloadDeletionLag(@PathParam("property") String property,
public Long getOffloadDeletionLag(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace) {
validateNamespaceName(property, namespace);
validateNamespaceName(tenant, namespace);
return internalGetOffloadDeletionLag();
}

@PUT
@Path("/{property}/{namespace}/offloadDeletionLagMs")
@Path("/{tenant}/{namespace}/offloadDeletionLagMs")
@ApiOperation(value = "Set number of milliseconds to wait before deleting a ledger segment which has been offloaded"
+ " from the Pulsar cluster's local storage (i.e. BookKeeper)",
notes = "A negative value disables the deletion completely.")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification"),
@ApiResponse(code = 412, message = "offloadDeletionLagMs value is not valid") })
public void setOffloadDeletionLag(@PathParam("property") String property,
public void setOffloadDeletionLag(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace,
long newDeletionLagMs) {
validateNamespaceName(property, namespace);
validateNamespaceName(tenant, namespace);
internalSetOffloadDeletionLag(newDeletionLagMs);
}

@DELETE
@Path("/{property}/{namespace}/offloadDeletionLagMs")
@Path("/{tenant}/{namespace}/offloadDeletionLagMs")
@ApiOperation(value = "Clear the namespace configured offload deletion lag. The topics in the namespace"
+ " will fallback to using the default configured deletion lag for the broker")
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission"),
@ApiResponse(code = 404, message = "Namespace doesn't exist"),
@ApiResponse(code = 409, message = "Concurrent modification") })
public void clearOffloadDeletionLag(@PathParam("property") String property,
public void clearOffloadDeletionLag(@PathParam("tenant") String tenant,
@PathParam("namespace") String namespace) {
validateNamespaceName(property, namespace);
validateNamespaceName(tenant, namespace);
internalSetOffloadDeletionLag(null);
}

Expand Down
4 changes: 2 additions & 2 deletions site2/docs/admin-api-partitioned-topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $ bin/pulsar-admin topics create-partitioned-topic \
#### Java

```java
String topicName = "persistent://my-property/my-namespace/my-topic";
String topicName = "persistent://my-tenant/my-namespace/my-topic";
int numPartitions = 4;
admin.persistentTopics().createPartitionedTopic(topicName, numPartitions);
```
Expand All @@ -61,7 +61,7 @@ subcommand. Here's an example:

```shell
$ pulsar-admin topics get-partitioned-topic-metadata \
persistent://my-property/my-namespace/my-topic
persistent://my-tenant/my-namespace/my-topic
{
"partitions": 4
}
Expand Down
8 changes: 4 additions & 4 deletions site2/docs/administration-geo.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Without geo-replication, consumers **C1** and **C2** wouldn't be able to consume

## Geo-replication and Pulsar properties

Geo-replication must be enabled on a per-tenant basis in Pulsar. Geo-replication can be enabled between clusters only when a property has been created that allows access to both clusters.
Geo-replication must be enabled on a per-tenant basis in Pulsar. Geo-replication can be enabled between clusters only when a tenant has been created that allows access to both clusters.

Although geo-replication must be enabled between two clusters, it's actually managed at the namespace level. You must do the following to enable geo-replication for a namespace:

Expand Down Expand Up @@ -48,17 +48,17 @@ As stated [above](#geo-replication-and-pulsar-properties), geo-replication in Pu

### Granting permissions to properties

To establish replication to a cluster, the tenant needs permission to use that cluster. This permission can be granted when the property is created or later on.
To establish replication to a cluster, the tenant needs permission to use that cluster. This permission can be granted when the tenant is created or later on.

At creation time, specify all the intended clusters:

```shell
$ bin/pulsar-admin properties create my-property \
$ bin/pulsar-admin properties create my-tenant \
--admin-roles my-admin-role \
--allowed-clusters us-west,us-east,us-cent
```

To update permissions of an existing property, use `update` instead of `create`.
To update permissions of an existing tenant, use `update` instead of `create`.

### Creating global namespaces

Expand Down
2 changes: 1 addition & 1 deletion site2/docs/concepts-architecture-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ In addition to message data, *cursors* are also persistently stored in BookKeepe
At the moment, Pulsar only supports persistent message storage. This accounts for the `persistent` in all topic names. Here's an example:

```http
persistent://my-property/my-namespace/my-topic
persistent://my-tenant/my-namespace/my-topic
```

> Pulsar also supports ephemeral ([non-persistent](concepts-messaging.md#non-persistent-topics)) message storage.
Expand Down
2 changes: 1 addition & 1 deletion site2/docs/cookbooks-partitioned.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ With that implementation in hand, you can send

```java
String pulsarBrokerRootUrl = "pulsar://localhost:6650";
String topic = "persistent://my-property/my-cluster-my-namespace/my-topic";
String topic = "persistent://my-tenant/my-cluster-my-namespace/my-topic";

PulsarClient client = PulsarClient.create(pulsarBrokerRootUrl);
ProducerConfiguration config = new ProducerConfiguration();
Expand Down
4 changes: 2 additions & 2 deletions site2/docs/deploy-kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ $ pulsar-admin namespaces list ten
ns
```

Now that you have a namespace and property set up, you can move on to [experimenting with your Pulsar cluster](#experimenting-with-your-cluster) from within the cluster or [connecting to the cluster](#client-connections) using a Pulsar client.
Now that you have a namespace and tenant set up, you can move on to [experimenting with your Pulsar cluster](#experimenting-with-your-cluster) from within the cluster or [connecting to the cluster](#client-connections) using a Pulsar client.

#### Experimenting with your cluster

Now that a property and namespace have been created, you can begin experimenting with your running Pulsar cluster. Using the same `pulsar-admin` pod via an alias, as in the section above, you can use [`pulsar-perf`](reference-cli-tools.md#pulsar-perf) to create a test [producer](reference-terminology.md#producer) to publish 10,000 messages a second on a topic in the [tenant](reference-terminology.md#tenant) and [namespace](reference-terminology.md#namespace) you created.
Now that a tenant and namespace have been created, you can begin experimenting with your running Pulsar cluster. Using the same `pulsar-admin` pod via an alias, as in the section above, you can use [`pulsar-perf`](reference-cli-tools.md#pulsar-perf) to create a test [producer](reference-terminology.md#producer) to publish 10,000 messages a second on a topic in the [tenant](reference-terminology.md#tenant) and [namespace](reference-terminology.md#namespace) you created.

First, create an alias to use the `pulsar-perf` tool via the admin pod:

Expand Down
2 changes: 1 addition & 1 deletion site2/docs/security-authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $ bin/pulsar-admin tenants create my-tenant \

This command will create a new tenant `my-tenant` that will be allowed to use the clusters `us-west` and `us-east`.

A client that successfully identified itself as having the role `my-admin-role` would then be allowed to perform all administrative tasks on this property.
A client that successfully identified itself as having the role `my-admin-role` would then be allowed to perform all administrative tasks on this tenant.

The structure of topic names in Pulsar reflects the hierarchy between tenants, clusters, and namespaces:

Expand Down
4 changes: 2 additions & 2 deletions site2/docs/security-encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ProducerConfiguration prodConf = new ProducerConfiguration();
prodConf.setCryptoKeyReader(new RawFileKeyReader("test_ecdsa_pubkey.pem", "test_ecdsa_privkey.pem"));
prodConf.addEncryptionKey("myappkey");

Producer producer = pulsarClient.createProducer("persistent://my-property/use/my-ns/my-topic", prodConf);
Producer producer = pulsarClient.createProducer("persistent://my-tenant/my-ns/my-topic", prodConf);

for (int i = 0; i < 10; i++) {
producer.send("my-message".getBytes());
Expand Down Expand Up @@ -126,7 +126,7 @@ class RawFileKeyReader implements CryptoKeyReader {
ConsumerConfiguration consConf = new ConsumerConfiguration();
consConf.setCryptoKeyReader(new RawFileKeyReader("test_ecdsa_pubkey.pem", "test_ecdsa_privkey.pem"));
PulsarClient pulsarClient = PulsarClient.create("http://localhost:8080");
Consumer consumer = pulsarClient.subscribe("persistent://my-property/use/my-ns/my-topic", "my-subscriber-name", consConf);
Consumer consumer = pulsarClient.subscribe("persistent://my-tenant/my-ns/my-topic", "my-subscriber-name", consConf);
Message msg = null;

for (int i = 0; i < 10; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $ bin/pulsar-admin topics create-partitioned-topic \
#### Java

```java
String topicName = "persistent://my-property/my-namespace/my-topic";
String topicName = "persistent://my-tenant/my-namespace/my-topic";
int numPartitions = 4;
admin.persistentTopics().createPartitionedTopic(topicName, numPartitions);
```
Expand All @@ -62,7 +62,7 @@ subcommand. Here's an example:

```shell
$ pulsar-admin topics get-partitioned-topic-metadata \
persistent://my-property/my-namespace/my-topic
persistent://my-tenant/my-namespace/my-topic
{
"partitions": 4
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Without geo-replication, consumers **C1** and **C2** wouldn't be able to consume

## Geo-replication and Pulsar properties

Geo-replication must be enabled on a per-tenant basis in Pulsar. Geo-replication can be enabled between clusters only when a property has been created that allows access to both clusters.
Geo-replication must be enabled on a per-tenant basis in Pulsar. Geo-replication can be enabled between clusters only when a tenant has been created that allows access to both clusters.

Although geo-replication must be enabled between two clusters, it's actually managed at the namespace level. You must do the following to enable geo-replication for a namespace:

Expand Down Expand Up @@ -49,17 +49,17 @@ As stated [above](#geo-replication-and-pulsar-properties), geo-replication in Pu

### Granting permissions to properties

To establish replication to a cluster, the tenant needs permission to use that cluster. This permission can be granted when the property is created or later on.
To establish replication to a cluster, the tenant needs permission to use that cluster. This permission can be granted when the tenant is created or later on.

At creation time, specify all the intended clusters:

```shell
$ bin/pulsar-admin properties create my-property \
$ bin/pulsar-admin properties create my-tenant \
--admin-roles my-admin-role \
--allowed-clusters us-west,us-east,us-cent
```

To update permissions of an existing property, use `update` instead of `create`.
To update permissions of an existing tenant, use `update` instead of `create`.

### Creating global namespaces

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ In addition to message data, *cursors* are also persistently stored in BookKeepe
At the moment, Pulsar only supports persistent message storage. This accounts for the `persistent` in all topic names. Here's an example:

```http
persistent://my-property/my-namespace/my-topic
persistent://my-tenant/my-namespace/my-topic
```

> Pulsar also supports ephemeral ([non-persistent](concepts-messaging.md#non-persistent-topics)) message storage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ With that implementation in hand, you can send

```java
String pulsarBrokerRootUrl = "pulsar://localhost:6650";
String topic = "persistent://my-property/my-cluster-my-namespace/my-topic";
String topic = "persistent://my-tenant/my-cluster-my-namespace/my-topic";

PulsarClient client = PulsarClient.create(pulsarBrokerRootUrl);
ProducerConfiguration config = new ProducerConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ $ pulsar-admin namespaces list ten
ns
```

Now that you have a namespace and property set up, you can move on to [experimenting with your Pulsar cluster](#experimenting-with-your-cluster) from within the cluster or [connecting to the cluster](#client-connections) using a Pulsar client.
Now that you have a namespace and tenant set up, you can move on to [experimenting with your Pulsar cluster](#experimenting-with-your-cluster) from within the cluster or [connecting to the cluster](#client-connections) using a Pulsar client.

#### Experimenting with your cluster

Now that a property and namespace have been created, you can begin experimenting with your running Pulsar cluster. Using the same `pulsar-admin` pod via an alias, as in the section above, you can use [`pulsar-perf`](reference-cli-tools.md#pulsar-perf) to create a test [producer](reference-terminology.md#producer) to publish 10,000 messages a second on a topic in the [tenant](reference-terminology.md#tenant) and [namespace](reference-terminology.md#namespace) you created.
Now that a tenant and namespace have been created, you can begin experimenting with your running Pulsar cluster. Using the same `pulsar-admin` pod via an alias, as in the section above, you can use [`pulsar-perf`](reference-cli-tools.md#pulsar-perf) to create a test [producer](reference-terminology.md#producer) to publish 10,000 messages a second on a topic in the [tenant](reference-terminology.md#tenant) and [namespace](reference-terminology.md#namespace) you created.

First, create an alias to use the `pulsar-perf` tool via the admin pod:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $ bin/pulsar-admin tenants create my-tenant \

This command will create a new tenant `my-tenant` that will be allowed to use the clusters `us-west` and `us-east`.

A client that successfully identified itself as having the role `my-admin-role` would then be allowed to perform all administrative tasks on this property.
A client that successfully identified itself as having the role `my-admin-role` would then be allowed to perform all administrative tasks on this tenant.

The structure of topic names in Pulsar reflects the hierarchy between tenants, clusters, and namespaces:

Expand Down
Loading

0 comments on commit 15441f8

Please sign in to comment.