use of org.apache.bookkeeper.mledger.proto.MLDataFormats.OffloadContext in project pulsar by yahoo.
the class OffloadUtils method getOffloadDriverMetadata.
public static Map<String, String> getOffloadDriverMetadata(LedgerInfo ledgerInfo, Map<String, String> defaultOffloadDriverMetadata) {
if (ledgerInfo.hasOffloadContext()) {
OffloadContext ctx = ledgerInfo.getOffloadContext();
if (ctx.hasDriverMetadata()) {
OffloadDriverMetadata driverMetadata = ctx.getDriverMetadata();
if (driverMetadata.getPropertiesCount() > 0) {
Map<String, String> metadata = Maps.newHashMap();
driverMetadata.getPropertiesList().forEach(kv -> metadata.put(kv.getKey(), kv.getValue()));
return metadata;
}
}
}
return defaultOffloadDriverMetadata;
}
use of org.apache.bookkeeper.mledger.proto.MLDataFormats.OffloadContext in project incubator-pulsar by apache.
the class OffloadUtils method getOffloadDriverMetadata.
public static Map<String, String> getOffloadDriverMetadata(LedgerInfo ledgerInfo, Map<String, String> defaultOffloadDriverMetadata) {
if (ledgerInfo.hasOffloadContext()) {
OffloadContext ctx = ledgerInfo.getOffloadContext();
if (ctx.hasDriverMetadata()) {
OffloadDriverMetadata driverMetadata = ctx.getDriverMetadata();
if (driverMetadata.getPropertiesCount() > 0) {
Map<String, String> metadata = Maps.newHashMap();
driverMetadata.getPropertiesList().forEach(kv -> metadata.put(kv.getKey(), kv.getValue()));
return metadata;
}
}
}
return defaultOffloadDriverMetadata;
}
use of org.apache.bookkeeper.mledger.proto.MLDataFormats.OffloadContext in project pulsar by apache.
the class OffloadUtils method getOffloadDriverMetadata.
public static Map<String, String> getOffloadDriverMetadata(LedgerInfo ledgerInfo, Map<String, String> defaultOffloadDriverMetadata) {
if (ledgerInfo.hasOffloadContext()) {
OffloadContext ctx = ledgerInfo.getOffloadContext();
if (ctx.hasDriverMetadata()) {
OffloadDriverMetadata driverMetadata = ctx.getDriverMetadata();
if (driverMetadata.getPropertiesCount() > 0) {
Map<String, String> metadata = Maps.newHashMap();
driverMetadata.getPropertiesList().forEach(kv -> metadata.put(kv.getKey(), kv.getValue()));
return metadata;
}
}
}
return defaultOffloadDriverMetadata;
}
Aggregations