For example, in Python, to resize a Disk Cache Tier instance with ID
disk2 to 500MB and set the high & low watermark percentages to 95% & 90%,
respectively:
To view a table's per-rank tier distribution, use the table_names
option of the /show/resource/statistics endpoint,
specifying the name of the table as the value.
For example, in Python, to show the per-rank tier distribution of the
preferred_customer table:
To process the response and format it into a table, using tabulate,
organized by rank and tier, first remove the entry for rank0 (which contains
no tables) and iterate through the remaining ranks:
distribution_headers=['Rank','Tier','ID','Size (bytes)','Priority','Evictable?']distribution_data=[]# Remove the entry for rank0, as it contains no table datadelranks["0"]forrankinranks:tiers=json.loads(ranks[rank])['tiers']fortierin(['VRAM','RAM']+' DISK'.join(' 0123456789').split(' ')+['PERSIST']+' COLD'.join(' 0123456789').split(' ')):iftierintiers:rank_tier_data=tiers[tier]['tables']['example.preferred_customer']ifrank_tier_data:distribution_data.extend([[rank,tier,item['id'],item['size'],item['pri'],item['ev']]foriteminrank_tier_data])print(tabulate(distribution_data,headers=distribution_headers,tablefmt='grid'))
Any resource groups can be created via the
API or GAdmin while the database is running. The following resource groups
will exist in every Kinetica instance:
system: used by the database for scheduling its own resources; cannot be
modified
default: default resource group;
can be modified when the database is stopped and will take effect when the
database is subsequently started
For example, in Python, to create a system administrator resource group
named memory_over_execution, which favors memory usage over execution speed
& priority, using the following criteria:
To show the resource groups assigned to a user, use the
/show/security endpoint.
For example, in Python, to show the resource group assigned directly to a
user named jsmith, and subsequently, resource groups assigned indirectly
through the user's roles:
To assign a tier strategy to a table upon creation, use the
/create/table endpoint.
For example, in Python, to create a table named preferred_customer and
assign a tier strategy with the default VRAM Tier and below-average
RAM Tiereviction priorities:
To assign a tier strategy to a table after creation, use the
/alter/table endpoint.
For example, in Python, to modify the preferred_customer table's tier
strategy to an above-average RAM eviction priority for customers seen in the
last week, and a moderately elevated RAM eviction priority for all other
customers:
To modify a table's tier strategy to have the following setup:
For id & name column data associated with customers seen in the last
minute, cache those column in VRAM and make them unevictable from the
RAM Tier
For all other data associated with customers seen in the last three days, give
the data the highest evictable priority within the RAM Tier
For all remaining data, decrease the eviction priority within the RAM Tier
slightly, while adding an above-average priority backing cache on the
Disk Cache Tier instance named disk2
To show a table's tier strategy, use the /show/table
endpoint.
For example, in Python, to show the tier strategy of a customer table:
1
2
3
4
# Show the customer table's tier strategycustomer_tier_strategy=table_customer_obj.show_table()['additional_info'][0]['strategy_definition']print("Tier strategy for preferred_customer table: {}".format(customer_tier_strategy))