use of org.apache.ranger.plugin.util.RangerReadWriteLock in project ranger by apache.
the class RangerTagEnricher method createLock.
protected RangerReadWriteLock createLock() {
String propertyPrefix = "ranger.plugin." + serviceDef.getName();
RangerPluginConfig config = getPluginConfig();
boolean deltasEnabled = config != null && config.getBoolean(propertyPrefix + RangerCommonConstants.PLUGIN_CONFIG_SUFFIX_TAG_DELTA, RangerCommonConstants.PLUGIN_CONFIG_SUFFIX_TAG_DELTA_DEFAULT);
boolean inPlaceUpdatesEnabled = config != null && config.getBoolean(propertyPrefix + RangerCommonConstants.PLUGIN_CONFIG_SUFFIX_IN_PLACE_TAG_UPDATES, RangerCommonConstants.PLUGIN_CONFIG_SUFFIX_IN_PLACE_TAG_UPDATES_DEFAULT);
boolean useReadWriteLock = deltasEnabled && inPlaceUpdatesEnabled;
LOG.info("Policy-Engine will" + (useReadWriteLock ? " " : " not ") + "use read-write locking to update tags in place when tag-deltas are provided");
return new RangerReadWriteLock(useReadWriteLock);
}
Aggregations