use of org.apache.pulsar.common.policies.data.RawBookieInfo in project pulsar by apache.
the class Bookies method getAllBookies.
@GET
@Path("/all")
@ApiOperation(value = "Gets raw information for all the bookies in the cluster", response = BookiesClusterInfo.class)
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission") })
public BookiesClusterInfo getAllBookies() throws Exception {
validateSuperUserAccess();
BookKeeper bookKeeper = bookKeeper();
MetadataClientDriver metadataClientDriver = bookKeeper.getMetadataClientDriver();
RegistrationClient registrationClient = metadataClientDriver.getRegistrationClient();
Set<BookieId> allBookies = registrationClient.getAllBookies().get().getValue();
List<RawBookieInfo> result = new ArrayList<>(allBookies.size());
for (BookieId bookieId : allBookies) {
RawBookieInfo bookieInfo = new RawBookieInfo(bookieId.toString());
result.add(bookieInfo);
}
return BookiesClusterInfo.builder().bookies(result).build();
}
use of org.apache.pulsar.common.policies.data.RawBookieInfo in project incubator-pulsar by apache.
the class Bookies method getAllBookies.
@GET
@Path("/all")
@ApiOperation(value = "Gets raw information for all the bookies in the cluster", response = BookiesClusterInfo.class)
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission") })
public BookiesClusterInfo getAllBookies() throws Exception {
validateSuperUserAccess();
BookKeeper bookKeeper = bookKeeper();
MetadataClientDriver metadataClientDriver = bookKeeper.getMetadataClientDriver();
RegistrationClient registrationClient = metadataClientDriver.getRegistrationClient();
Set<BookieId> allBookies = registrationClient.getAllBookies().get().getValue();
List<RawBookieInfo> result = new ArrayList<>(allBookies.size());
for (BookieId bookieId : allBookies) {
RawBookieInfo bookieInfo = new RawBookieInfo(bookieId.toString());
result.add(bookieInfo);
}
return BookiesClusterInfo.builder().bookies(result).build();
}
use of org.apache.pulsar.common.policies.data.RawBookieInfo in project pulsar by yahoo.
the class Bookies method getAllBookies.
@GET
@Path("/all")
@ApiOperation(value = "Gets raw information for all the bookies in the cluster", response = BookiesClusterInfo.class)
@ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have admin permission") })
public BookiesClusterInfo getAllBookies() throws Exception {
validateSuperUserAccess();
BookKeeper bookKeeper = bookKeeper();
MetadataClientDriver metadataClientDriver = bookKeeper.getMetadataClientDriver();
RegistrationClient registrationClient = metadataClientDriver.getRegistrationClient();
Set<BookieId> allBookies = registrationClient.getAllBookies().get().getValue();
List<RawBookieInfo> result = new ArrayList<>(allBookies.size());
for (BookieId bookieId : allBookies) {
RawBookieInfo bookieInfo = new RawBookieInfo(bookieId.toString());
result.add(bookieInfo);
}
return BookiesClusterInfo.builder().bookies(result).build();
}
Aggregations