Skip to content

Commit

Permalink
improve text
Browse files Browse the repository at this point in the history
  • Loading branch information
coderzc committed Sep 8, 2022
1 parent c8ad7f6 commit d914c5f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public void createCluster(
mediaType = MediaType.APPLICATION_JSON,
value = """
{
'serviceUrl': 'http://pulsar.example.com:8080',
'brokerServiceUrl': 'pulsar://pulsar.example.com:6651',
"serviceUrl": "http://pulsar.example.com:8080",
"brokerServiceUrl": "pulsar://pulsar.example.com:6651",
}
"""
)
Expand Down Expand Up @@ -204,8 +204,8 @@ public void updateCluster(
mediaType = MediaType.APPLICATION_JSON,
value = """
{
'serviceUrl': 'http://pulsar.example.com:8080',
'brokerServiceUrl': 'pulsar://pulsar.example.com:6651'
"serviceUrl": "http://pulsar.example.com:8080",
"brokerServiceUrl": "pulsar://pulsar.example.com:6651"
}
"""
)
Expand Down Expand Up @@ -251,8 +251,8 @@ public void setPeerClusterNames(@Suspended AsyncResponse asyncResponse,
value = @ExampleProperty(mediaType = MediaType.APPLICATION_JSON,
value = """
[
'cluster-a',
'cluster-b'
"cluster-a",
"cluster-b"
]""")))
LinkedHashSet<String> peerClusterNames) {
validateSuperUserAccessAsync()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,12 @@ public void updateFunction(
mediaType = MediaType.APPLICATION_JSON,
value = """
{
"inputs": persistent://public/default/input-topic,
"parallelism": 4
"output": persistent://public/default/output-topic
"log-topic": persistent://public/default/log-topic
"classname": org.example.test.ExclamationFunction
"jar": java-function-1.0-SNAPSHOT.jar
"inputs": "persistent://public/default/input-topic",
"parallelism": 4,
"output": "persistent://public/default/output-topic",
"log-topic": "persistent://public/default/log-topic",
"classname": "org.example.test.ExclamationFunction",
"jar": "java-function-1.0-SNAPSHOT.jar"
}
"""
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,27 +145,23 @@ public void registerSink(@ApiParam(value = "The tenant of a Pulsar Sink") final
value = {
@ExampleProperty(
mediaType = MediaType.TEXT_PLAIN,
value = "Example \n"
+ "\n"
+ " 1. Create a JSON object. \n"
+ "\n"
+ "{\n"
+ "\t\"classname\": \"org.example.MySinkTest\",\n"
+ "\t\"inputs\": ["
+ "\"persistent://public/default/sink-input\"],\n"
+ "\t\"processingGuarantees\": \"EFFECTIVELY_ONCE\",\n"
+ "\t\"parallelism\": \"10\"\n"
+ "}\n"
+ "\n"
+ "\n"
+ "2. Encapsulate the JSON object to a multipart object "
+ "(in Python).\n"
+ "\n"
+ "from requests_toolbelt.multipart.encoder import "
+ "MultipartEncoder \n"
+ "mp_encoder = MultipartEncoder( \n"
+ "\t[('sinkConfig', "
+ "(None, json.dumps(config), 'application/json'))])\n"
value = """
Example
1. Create a JSON object.
{
"classname": "org.example.MySinkTest",
"inputs": ["persistent://public/default/sink-input"],
"processingGuarantees": "EFFECTIVELY_ONCE",
"parallelism": "10"
}
2. Encapsulate the JSON object to a multipart object \
(in Python).
from requests_toolbelt.multipart.encoder import \
MultipartEncoder
mp_encoder = MultipartEncoder(\
[('sinkConfig',\
(None, json.dumps(config), 'application/json'))])
"""
)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,28 +119,24 @@ public void registerSource(
examples = @Example(
value = @ExampleProperty(
mediaType = MediaType.TEXT_PLAIN,
value = " Example \n"
+ "\n"
+ "1. Create a JSON object. \n"
+ "\n"
+ "{\n"
+ "\t\"tenant\": \"public\",\n"
+ "\t\"namespace\": \"default\",\n"
+ "\t\"name\": \"pulsar-io-mysql\",\n"
+ "\t\"className\": \"TestSourceMysql\",\n"
+ "\t\"topicName\": \"pulsar-io-mysql\",\n"
+ "\t\"parallelism\": \"1\",\n"
+ "\t\"archive\": \"/connectors/pulsar-io-mysql-0.0.1.nar\",\n"
+ "\t\"schemaType\": \"avro\"\n"
+ "}\n"
+ "\n"
+ "\n"
+ "2. Encapsulate the JSON object to a multipart object (in Python). \n"
+ "\n"
+ "from requests_toolbelt.multipart.encoder import MultipartEncoder \n"
+ "mp_encoder = MultipartEncoder( \n"
+ "\t[('sourceConfig', "
+ "(None, json.dumps(config), 'application/json'))])\n"
value = """
Example
1. Create a JSON object.
{
"tenant": "public",
"namespace": "default",
"name": "pulsar-io-mysql",
"className": "TestSourceMysql",
"topicName": "pulsar-io-mysql",
"parallelism": "1",
"archive": "/connectors/pulsar-io-mysql-0.0.1.nar",
"schemaType": "avro"
}
2. Encapsulate the JSON object to a multipart object (in Python).
from requests_toolbelt.multipart.encoder import MultipartEncoder
mp_encoder = MultipartEncoder([('sourceConfig', \
(None, json.dumps(config), 'application/json'))])
"""
)
)
)
Expand Down

0 comments on commit d914c5f

Please sign in to comment.