use of org.apache.pulsar.common.schema.SchemaInfoWithVersion in project pulsar by yahoo.
the class SchemasImpl method getSchemaInfoWithVersionAsync.
@Override
public CompletableFuture<SchemaInfoWithVersion> getSchemaInfoWithVersionAsync(String topic) {
TopicName tn = TopicName.get(topic);
final CompletableFuture<SchemaInfoWithVersion> future = new CompletableFuture<>();
asyncGetRequest(schemaPath(tn), new InvocationCallback<GetSchemaResponse>() {
@Override
public void completed(GetSchemaResponse response) {
future.complete(convertGetSchemaResponseToSchemaInfoWithVersion(tn, response));
}
@Override
public void failed(Throwable throwable) {
future.completeExceptionally(getApiException(throwable.getCause()));
}
});
return future;
}
use of org.apache.pulsar.common.schema.SchemaInfoWithVersion in project incubator-pulsar by apache.
the class SchemasImpl method getSchemaInfoWithVersionAsync.
@Override
public CompletableFuture<SchemaInfoWithVersion> getSchemaInfoWithVersionAsync(String topic) {
TopicName tn = TopicName.get(topic);
final CompletableFuture<SchemaInfoWithVersion> future = new CompletableFuture<>();
asyncGetRequest(schemaPath(tn), new InvocationCallback<GetSchemaResponse>() {
@Override
public void completed(GetSchemaResponse response) {
future.complete(convertGetSchemaResponseToSchemaInfoWithVersion(tn, response));
}
@Override
public void failed(Throwable throwable) {
future.completeExceptionally(getApiException(throwable.getCause()));
}
});
return future;
}
use of org.apache.pulsar.common.schema.SchemaInfoWithVersion in project incubator-pulsar by apache.
the class AdminApiSchemaTest method testSchemaInfoWithVersionApi.
private <T> void testSchemaInfoWithVersionApi(Schema<T> schema, String topicName) throws Exception {
SchemaInfo si = schema.getSchemaInfo();
admin.schemas().createSchema(topicName, si);
log.info("Upload schema to topic {} : {}", topicName, si);
SchemaInfoWithVersion readSi = admin.schemas().getSchemaInfoWithVersion(topicName);
log.info("Read schema of topic {} : {}", topicName, readSi);
assertEquals(readSi.getSchemaInfo(), si);
assertEquals(readSi.getVersion(), 0);
readSi = admin.schemas().getSchemaInfoWithVersion(topicName + "-partition-0");
log.info("Read schema of topic {} : {}", topicName, readSi);
assertEquals(readSi.getSchemaInfo(), si);
assertEquals(readSi.getVersion(), 0);
}
use of org.apache.pulsar.common.schema.SchemaInfoWithVersion in project pulsar by yahoo.
the class AdminApiSchemaTest method testSchemaInfoWithVersionApi.
private <T> void testSchemaInfoWithVersionApi(Schema<T> schema, String topicName) throws Exception {
SchemaInfo si = schema.getSchemaInfo();
admin.schemas().createSchema(topicName, si);
log.info("Upload schema to topic {} : {}", topicName, si);
SchemaInfoWithVersion readSi = admin.schemas().getSchemaInfoWithVersion(topicName);
log.info("Read schema of topic {} : {}", topicName, readSi);
assertEquals(readSi.getSchemaInfo(), si);
assertEquals(readSi.getVersion(), 0);
readSi = admin.schemas().getSchemaInfoWithVersion(topicName + "-partition-0");
log.info("Read schema of topic {} : {}", topicName, readSi);
assertEquals(readSi.getSchemaInfo(), si);
assertEquals(readSi.getVersion(), 0);
}
use of org.apache.pulsar.common.schema.SchemaInfoWithVersion in project pulsar by apache.
the class AdminApiSchemaTest method testSchemaInfoWithVersionApi.
private <T> void testSchemaInfoWithVersionApi(Schema<T> schema, String topicName) throws Exception {
SchemaInfo si = schema.getSchemaInfo();
admin.schemas().createSchema(topicName, si);
log.info("Upload schema to topic {} : {}", topicName, si);
SchemaInfoWithVersion readSi = admin.schemas().getSchemaInfoWithVersion(topicName);
log.info("Read schema of topic {} : {}", topicName, readSi);
assertEquals(readSi.getSchemaInfo(), si);
assertEquals(readSi.getVersion(), 0);
readSi = admin.schemas().getSchemaInfoWithVersion(topicName + "-partition-0");
log.info("Read schema of topic {} : {}", topicName, readSi);
assertEquals(readSi.getSchemaInfo(), si);
assertEquals(readSi.getVersion(), 0);
}
Aggregations