Skip to content

Commit b0656be

Browse files
committed
RANGER-4910: addressed review suggesstions; updated to load Polaris service-def during initialization
1 parent a0a9072 commit b0656be

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

agents-common/src/main/java/org/apache/ranger/plugin/store/EmbeddedServiceDefsUtil.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class EmbeddedServiceDefsUtil {
4949
private static final Logger LOG = LoggerFactory.getLogger(EmbeddedServiceDefsUtil.class);
5050

5151
// following servicedef list should be reviewed/updated whenever a new embedded service-def is added
52-
public static final String DEFAULT_BOOTSTRAP_SERVICEDEF_LIST = "tag,gds,hdfs,hbase,hive,kms,knox,storm,yarn,kafka,solr,atlas,nifi,nifi-registry,sqoop,kylin,elasticsearch,presto,trino,ozone,kudu,schema-registry,nestedstructure";
52+
public static final String DEFAULT_BOOTSTRAP_SERVICEDEF_LIST = "tag,gds,hdfs,hbase,hive,kms,knox,storm,yarn,kafka,solr,atlas,nifi,nifi-registry,sqoop,kylin,elasticsearch,presto,trino,ozone,kudu,schema-registry,nestedstructure,polaris";
5353
public static final String EMBEDDED_SERVICEDEF_TAG_NAME = "tag";
5454
public static final String EMBEDDED_SERVICEDEF_GDS_NAME = "gds";
5555
public static final String EMBEDDED_SERVICEDEF_HDFS_NAME = "hdfs";
@@ -75,6 +75,7 @@ public class EmbeddedServiceDefsUtil {
7575
public static final String EMBEDDED_SERVICEDEF_OZONE_NAME = "ozone";
7676
public static final String EMBEDDED_SERVICEDEF_KUDU_NAME = "kudu";
7777
public static final String EMBEDDED_SERVICEDEF_NESTEDSTRUCTURE_NAME = "nestedstructure";
78+
public static final String EMBEDDED_SERVICEDEF_POLARIS_NAME = "polaris";
7879

7980
public static final String PROPERTY_CREATE_EMBEDDED_SERVICE_DEFS = "ranger.service.store.create.embedded.service-defs";
8081
public static final String HDFS_IMPL_CLASS_NAME = "org.apache.ranger.services.hdfs.RangerServiceHdfs";
@@ -123,6 +124,7 @@ public class EmbeddedServiceDefsUtil {
123124
private RangerServiceDef ozoneServiceDef;
124125
private RangerServiceDef kuduServiceDef;
125126
private RangerServiceDef nestedStructureServiveDef;
127+
private RangerServiceDef polarisServiceDef;
126128
private RangerServiceDef tagServiceDef;
127129
private RangerServiceDef gdsServiceDef;
128130

@@ -186,6 +188,7 @@ public void init(ServiceStore store) {
186188
ozoneServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_OZONE_NAME);
187189
kuduServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_KUDU_NAME);
188190
nestedStructureServiveDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_NESTEDSTRUCTURE_NAME);
191+
polarisServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_POLARIS_NAME);
189192

190193
gdsServiceDef = getOrCreateServiceDef(store, EMBEDDED_SERVICEDEF_GDS_NAME);
191194

@@ -289,6 +292,10 @@ public long getNestedStructureServiceDefId() {
289292
return getId(nestedStructureServiveDef);
290293
}
291294

295+
public long getPolarisServiceDefId() {
296+
return getId(polarisServiceDef);
297+
}
298+
292299
public long getTagServiceDefId() {
293300
return getId(tagServiceDef);
294301
}

agents-common/src/main/resources/service-defs/ranger-servicedef-polaris.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@
168168
{ "itemId": 73, "name": "table-policy-attach", "label": "Table Policy Attach", "category": "MANAGE" },
169169
{ "itemId": 74, "name": "table-policy-detach", "label": "Table Policy Detach", "category": "MANAGE" },
170170
{ "itemId": 75, "name": "table-properties-read", "label": "Table Properties Read", "category": "READ" },
171-
{ "itemId": 76, "name": "table-properties-write", "label": "Table Properties Write", "category": "MANAGE" },
171+
{ "itemId": 76, "name": "table-properties-write", "label": "Table Properties Write", "category": "UPDATE" },
172172
{ "itemId": 77, "name": "table-properties-set", "label": "Table Properties Set", "category": "MANAGE" },
173173
{ "itemId": 78, "name": "table-properties-remove", "label": "Table Properties Remove", "category": "MANAGE" },
174174
{ "itemId": 79, "name": "table-uuid-assign", "label": "Table UUID Assign", "category": "MANAGE" },
175175
{ "itemId": 80, "name": "table-format-version-upgrade", "label": "Table Format Version Upgrade", "category": "MANAGE" },
176176
{ "itemId": 81, "name": "table-schema-add", "label": "Table Schema Add", "category": "MANAGE" },
177-
{ "itemId": 82, "name": "table-schema-set-current", "label": "Table Schema Set Current", "category": "READ" },
177+
{ "itemId": 82, "name": "table-schema-set-current", "label": "Table Schema Set Current", "category": "MANAGE" },
178178
{ "itemId": 83, "name": "table-partition-spec-add", "label": "Table Partition Spec Add", "category": "MANAGE" },
179179
{ "itemId": 84, "name": "table-partition-specs-remove", "label": "Table Partition Specs Remove", "category": "MANAGE" },
180180
{ "itemId": 85, "name": "table-sort-order-add", "label": "Table Sort Order Add", "category": "MANAGE" },
@@ -195,6 +195,6 @@
195195
{ "itemId": 99, "name": "view-grants-manage", "label": "View Grants Manage", "category": "MANAGE" },
196196
{ "itemId": 100, "name": "view-metadata-full", "label": "View Metadata Full", "category": "MANAGE" },
197197
{ "itemId": 101, "name": "view-properties-read", "label": "View Properties Read", "category": "READ" },
198-
{ "itemId": 102, "name": "view-properties-write", "label": "View Properties Write", "category": "MANAGE" }
198+
{ "itemId": 102, "name": "view-properties-write", "label": "View Properties Write", "category": "UPDATE" }
199199
]
200200
}

0 commit comments

Comments
 (0)