@Override public SchemaMetadataInfo getSchemaMetadataInfo(Long schemaMetadataId) { return schemaRegistry.getSchemaMetadataInfo(schemaMetadataId); }
@Override public SchemaMetadataInfo getSchemaMetadataInfo(String schemaName) { return schemaRegistry.getSchemaMetadataInfo(schemaName); }
@GET @Path("/schemasById/{schemaId}") @ApiOperation(value = "Get schema for a given schema identifier", response = SchemaMetadataInfo.class, tags = OPERATION_GROUP_SCHEMA) @Timed @UnitOfWork public Response getSchemaInfo(@ApiParam(value = "Schema identifier", required = true) @PathParam("schemaId") Long schemaId) { Response response; try { SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(schemaId); if (schemaMetadataInfo != null) { response = WSUtils.respondEntity(schemaMetadataInfo, Response.Status.OK); } else { response = WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaId.toString()); } } catch (Exception ex) { LOG.error("Encountered error while retrieving SchemaInfo with schemaId: [{}]", schemaId, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
@GET @Path("/schemasById/{schemaId}") @ApiOperation(value = "Get schema for a given schema identifier", response = SchemaMetadataInfo.class, tags = OPERATION_GROUP_SCHEMA) @Timed @UnitOfWork public Response getSchemaInfo(@ApiParam(value = "Schema identifier", required = true) @PathParam("schemaId") Long schemaId) { Response response; try { SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(schemaId); if (schemaMetadataInfo != null) { response = WSUtils.respondEntity(schemaMetadataInfo, Response.Status.OK); } else { response = WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaId.toString()); } } catch (Exception ex) { LOG.error("Encountered error while retrieving SchemaInfo with schemaId: [{}]", schemaId, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
@GET @Path("/schemas/{name}") @ApiOperation(value = "Get schema information for the given schema name", response = SchemaMetadataInfo.class, tags = OPERATION_GROUP_SCHEMA) @Timed @UnitOfWork public Response getSchemaInfo(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName) { Response response; try { SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(schemaName); if (schemaMetadataInfo != null) { response = WSUtils.respondEntity(schemaMetadataInfo, Response.Status.OK); } else { response = WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaName); } } catch (Exception ex) { LOG.error("Encountered error while retrieving SchemaInfo with name: [{}]", schemaName, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
@GET @Path("/schemas/{name}") @ApiOperation(value = "Get schema information for the given schema name", response = SchemaMetadataInfo.class, tags = OPERATION_GROUP_SCHEMA) @Timed @UnitOfWork public Response getSchemaInfo(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName) { Response response; try { SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(schemaName); if (schemaMetadataInfo != null) { response = WSUtils.respondEntity(schemaMetadataInfo, Response.Status.OK); } else { response = WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaName); } } catch (Exception ex) { LOG.error("Encountered error while retrieving SchemaInfo with name: [{}]", schemaName, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
@GET @Path("/schemas/{name}/serdes") @ApiOperation(value = "Get list of Serializers registered for the given schema name", response = SerDesInfo.class, responseContainer = "List", tags = OPERATION_GROUP_SERDE) @Timed @UnitOfWork public Response getSerializers(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName) { Response response; try { SchemaMetadataInfo schemaMetadataInfoStorable = schemaRegistry.getSchemaMetadataInfo(schemaName); if (schemaMetadataInfoStorable != null) { Collection<SerDesInfo> schemaSerializers = schemaRegistry.getSerDes(schemaMetadataInfoStorable.getSchemaMetadata().getName()); response = WSUtils.respondEntities(schemaSerializers, Response.Status.OK); } else { LOG.info("No schemas found with schemakey: [{}]", schemaName); response = WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaName); } } catch (Exception ex) { LOG.error("Encountered error while getting serializers for schemaKey [{}]", schemaName, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
@GET @Path("/schemas/{name}/serdes") @ApiOperation(value = "Get list of Serializers registered for the given schema name", response = SerDesInfo.class, responseContainer = "List", tags = OPERATION_GROUP_SERDE) @Timed @UnitOfWork public Response getSerializers(@ApiParam(value = "Schema name", required = true) @PathParam("name") String schemaName) { Response response; try { SchemaMetadataInfo schemaMetadataInfoStorable = schemaRegistry.getSchemaMetadataInfo(schemaName); if (schemaMetadataInfoStorable != null) { Collection<SerDesInfo> schemaSerializers = schemaRegistry.getSerDes(schemaMetadataInfoStorable.getSchemaMetadata().getName()); response = WSUtils.respondEntities(schemaSerializers, Response.Status.OK); } else { LOG.info("No schemas found with schemakey: [{}]", schemaName); response = WSUtils.respond(Response.Status.NOT_FOUND, CatalogResponse.ResponseMessage.ENTITY_NOT_FOUND, schemaName); } } catch (Exception ex) { LOG.error("Encountered error while getting serializers for schemaKey [{}]", schemaName, ex); response = WSUtils.respond(Response.Status.INTERNAL_SERVER_ERROR, CatalogResponse.ResponseMessage.EXCEPTION, ex.getMessage()); } return response; }
schemaVersionInfo = schemaRegistry.getLatestSchemaVersionInfo(subject); } else { SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(subject); if (schemaMetadataInfo == null) { throw new SchemaNotFoundException();
schemaVersionInfo = schemaRegistry.getLatestSchemaVersionInfo(subject); } else { SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(subject); if (schemaMetadataInfo == null) { throw new SchemaNotFoundException();
try { LOG.info("registerSchema for [{}] is [{}]", subject); SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(subject); if (schemaMetadataInfo == null) { SchemaMetadata schemaMetadata = new SchemaMetadata.Builder(subject) schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(subject);
try { LOG.info("registerSchema for [{}] is [{}]", subject); SchemaMetadataInfo schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(subject); if (schemaMetadataInfo == null) { SchemaMetadata schemaMetadata = new SchemaMetadata.Builder(subject) schemaMetadataInfo = schemaRegistry.getSchemaMetadataInfo(subject);