コード例 #1
0
def main():
    details = HiveParser.getConnectionDetails()
    print "Transaction State Summary:"
    HiveParser.runSql(
        details, "select TXN_STATE, count(*) from TXNS group by TXN_STATE")

    print "Average number of partitions per transaction:"
    HiveParser.runSql(
        details,
        "select avg(c) from (select count(*) c from COMPLETED_TXN_COMPONENTS group by CTC_TXNID) s"
    )

    print "Details of aborted transactions:"
    HiveParser.runSql(
        details,
        "select * from TXNS, TXN_COMPONENTS where TXNS.TXN_ID = TXN_COMPONENTS.TC_TXNID"
    )

    print "Compaction details:"
    HiveParser.runSql(details, "select * from COMPACTION_QUEUE")

    print "Current locks:"
    HiveParser.runSql(details, "select * from HIVE_LOCKS")
コード例 #2
0
def main():
    details = HiveParser.getConnectionDetails()
    command = HiveParser.getConnectCommand(details)
    if details["type"] == "mysql":
        os.execv("/bin/sh", ["sh", "-c", command])
コード例 #3
0
ファイル: dumpMetastore.py プロジェクト: srini-hdp/structor
def main():
	details = HiveParser.getConnectionDetails()
	command = HiveParser.getDumpCommand(details)
	os.system(command)
コード例 #4
0
ファイル: connectMetastore.py プロジェクト: apsaltis/structor
def main():
	details = HiveParser.getConnectionDetails()
	command = HiveParser.getConnectCommand(details)
	print "Connect string is:", command
	if details["type"] == "mysql":
		os.execv("/bin/sh", ["sh", "-c", command])
コード例 #5
0
def main():
	details = HiveParser.getConnectionDetails()
	print "Transaction State Summary:"
	HiveParser.runSql(details, "select TXN_STATE, count(*) from TXNS group by TXN_STATE")

	print "Average number of partitions per transaction:"
	HiveParser.runSql(details, "select avg(c) from (select count(*) c from COMPLETED_TXN_COMPONENTS group by CTC_TXNID) s")

	print "Details of aborted transactions:"
	HiveParser.runSql(details, "select * from TXNS, TXN_COMPONENTS where TXNS.TXN_ID = TXN_COMPONENTS.TC_TXNID")

	print "Compaction details:"
	HiveParser.runSql(details, "select * from COMPACTION_QUEUE")

	print "Current locks:"
	HiveParser.runSql(details, "select * from HIVE_LOCKS")
コード例 #6
0
def main():
    details = HiveParser.getConnectionDetails()
    command = HiveParser.getDumpCommand(details)
    os.system(command)