本文整理汇总了Python中mpp.lib.gpfilespace.Gpfilespace.get_filespace_directory方法的典型用法代码示例。如果您正苦于以下问题:Python Gpfilespace.get_filespace_directory方法的具体用法?Python Gpfilespace.get_filespace_directory怎么用?Python Gpfilespace.get_filespace_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpp.lib.gpfilespace.Gpfilespace
的用法示例。
在下文中一共展示了Gpfilespace.get_filespace_directory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GpFilespaceRegressionTests
# 需要导入模块: from mpp.lib.gpfilespace import Gpfilespace [as 别名]
# 或者: from mpp.lib.gpfilespace.Gpfilespace import get_filespace_directory [as 别名]
class GpFilespaceRegressionTests(unittest.TestCase):
def __init__(self, methodName):
self.gpfs = Gpfilespace()
self.gpfs_h = HAWQGpfilespace()
super(GpFilespaceRegressionTests, self).__init__(methodName)
def tearDown(self):
PSQL.run_sql_command('Drop filespace test_fs_a;')
def test_create_filespace(self):
self.gpfs.create_filespace('test_fs_a')
fs_list = PSQL.run_sql_command("select fsname from pg_filespace where fsname<>'pg_system';", flags = '-q -t')
self.assertTrue('test_fs_a' in fs_list)
def test_drop_fiespace(self):
self.gpfs.create_filespace('test_fs_b')
self.assertTrue(self.gpfs.drop_filespace('test_fs_b'))
def test_fs_exists(self):
self.gpfs.create_filespace('test_fs_a')
self.assertTrue(self.gpfs.exists('test_fs_a'))
def test_showtempfiles(self):
result = self.gpfs.showtempfiles()
show = False
for line in result.stdout.splitlines():
if 'Current Filespace for TEMPORARY_FILES' in line:
show = True
self.assertTrue(show)
def test_get_filespace_location(self):
result = self.gpfs.get_filespace_location()
self.assertTrue(len(result) >0)
def test_get_filespace_directory(self):
result = self.gpfs.get_filespace_directory()
self.assertTrue(len(result) >0)
def test_get_hosts_for_filespace(self):
self.gpfs.create_filespace('test_fs_a')
fs_location = PSQL.run_sql_command("select fselocation from pg_filespace_entry where fselocation like '%test_fs_a%' and fsedbid=2;", flags = '-q -t')
result = self.gpfs.get_hosts_for_filespace(fs_location.strip())
self.assertEquals(result[0]['location'],fs_location.strip())
def test_create_filespace_hawq(self):
self.gpfs_h.create_filespace('test_fs_hq')
fs_list = PSQL.run_sql_command("select fsname from pg_filespace where fsname<>'pg_system';", flags = '-q -t')
self.assertTrue('test_fs_hq' in fs_list)