本文整理汇总了Python中liboozie.credentials.Credentials.get_properties方法的典型用法代码示例。如果您正苦于以下问题:Python Credentials.get_properties方法的具体用法?Python Credentials.get_properties怎么用?Python Credentials.get_properties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类liboozie.credentials.Credentials
的用法示例。
在下文中一共展示了Credentials.get_properties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _update_properties
# 需要导入模块: from liboozie.credentials import Credentials [as 别名]
# 或者: from liboozie.credentials.Credentials import get_properties [as 别名]
def _update_properties(self, jobtracker_addr, deployment_dir=None):
LOG.info('Using FS %s and JT %s' % (self.fs, self.jt))
if self.jt and self.jt.logical_name:
jobtracker_addr = self.jt.logical_name
if self.fs.logical_name:
fs_defaultfs = self.fs.logical_name
else:
fs_defaultfs = self.fs.fs_defaultfs
self.properties.update({
'jobTracker': jobtracker_addr,
'nameNode': fs_defaultfs,
})
if self.job and deployment_dir:
self.properties.update({
self.job.PROPERTY_APP_PATH: self.fs.get_hdfs_path(deployment_dir),
self.job.HUE_ID: self.job.id
})
# Generate credentials when using security
if self.api.security_enabled:
credentials = Credentials()
credentials.fetch(self.api)
self.properties['credentials'] = credentials.get_properties()
示例2: test_gen_properties
# 需要导入模块: from liboozie.credentials import Credentials [as 别名]
# 或者: from liboozie.credentials.Credentials import get_properties [as 别名]
def test_gen_properties(self):
creds = Credentials(credentials=TestCredentials.CREDENTIALS.copy())
metastore = {
'thrift_uri': 'thrift://hue-koh-chang:9999',
'kerberos_principal': 'hive',
}
finish = (
beeswax.conf.HIVE_SERVER_HOST.set_for_testing('hue-koh-chang'),
beeswax.conf.HIVE_SERVER_PORT.set_for_testing(12345),
)
try:
assert_equal({
'hcat': {
'xml_name': 'hcat',
'properties': [
('hcat.metastore.uri', 'thrift://hue-koh-chang:9999'),
('hcat.metastore.principal', 'hive')
]},
'hive2': {
'xml_name': 'hive2',
'properties': [
('hive2.jdbc.url', 'jdbc:hive2://hue-koh-chang:12345/default'),
('hive2.server.principal', 'hive')
]},
'hbase': {
'xml_name': 'hbase',
'properties': []
}
}, creds.get_properties(metastore))
finally:
for f in finish:
f()
示例3: export_workflow
# 需要导入模块: from liboozie.credentials import Credentials [as 别名]
# 或者: from liboozie.credentials.Credentials import get_properties [as 别名]
def export_workflow(request, workflow):
mapping = dict([(param['name'], param['value']) for param in workflow.find_all_parameters()])
oozie_api = get_oozie(request.user)
credentials = Credentials()
credentials.fetch(oozie_api)
mapping['credentials'] = credentials.get_properties()
zip_file = workflow.compress(mapping=mapping)
response = HttpResponse(content_type="application/zip")
response["Last-Modified"] = http_date(time.time())
response["Content-Length"] = len(zip_file.getvalue())
response['Content-Disposition'] = 'attachment; filename="workflow-%s-%d.zip"' % (workflow.name, workflow.id)
response.write(zip_file.getvalue())
return response
示例4: _update_properties
# 需要导入模块: from liboozie.credentials import Credentials [as 别名]
# 或者: from liboozie.credentials.Credentials import get_properties [as 别名]
def _update_properties(self, jobtracker_addr, deployment_dir):
if self.fs and self.jt:
self.properties.update(
{
"jobTracker": self.jt.logical_name or jobtracker_addr,
"nameNode": self.fs.logical_name or self.fs.fs_defaultfs,
}
)
if self.job:
self.properties.update(
{
self.job.get_application_path_key(): self.fs.get_hdfs_path(deployment_dir),
self.job.HUE_ID: self.job.id,
}
)
# Generate credentials when using security
if self.api.security_enabled:
credentials = Credentials()
credentials.fetch(self.api)
self.properties["credentials"] = credentials.get_properties()