Skip to content

Instantly share code, notes, and snippets.

View avantgardnerio's full-sized avatar

Brent Gardner avantgardnerio

  • Coralogix
  • Denver, CO
View GitHub Profile
public TpccStatements(Connection conn, int fetchSize) throws Exception {
this.conn = conn;
// NewOrder statements.
pStmts[0] = prepareStatement("SELECT c.c_discount, c.c_last, c.c_credit, w.w_tax FROM customer AS c JOIN warehouse AS w ON c.c_w_id = w_id AND w.w_id = $1 AND c.c_w_id = $2 AND c.c_d_id = $3 AND c.c_id = $4");
pStmts[1] = prepareStatement("SELECT d_next_o_id, d_tax FROM district WHERE d_id = $1 AND d_w_id = $2 FOR UPDATE");
pStmts[2] = prepareStatement("UPDATE district SET d_next_o_id = $1 + 1 WHERE d_id = $2 AND d_w_id = $3");
pStmts[3] = prepareStatement("INSERT INTO orders (o_id, o_d_id, o_w_id, o_c_id, o_entry_d, o_ol_cnt, o_all_local) VALUES($1, $2, $3, $4, $5, $6, $7)");
pStmts[4] = prepareStatement("INSERT INTO new_orders (no_o_id, no_d_id, no_w_id) VALUES ($1,$2,$3)");
pStmts[5] = prepareStatement("SELECT i_price, i_name, i_data FROM item WHERE i_id = $1");
#[tokio::test]
async fn multi_node_test() {
let base_dir = env::temp_dir().join("coldb");
let _ = fs::remove_dir_all(&base_dir);
fs::create_dir_all(&base_dir).unwrap();
let node_cnt = 5;
let mut futures: FuturesUnordered<BoxFuture<_>> = FuturesUnordered::new();
let eps: HashMap<NodeId, String> = (1..=node_cnt)
.map(|id| {
#[tokio::test]
async fn test_select_1() -> Result<(), Error> {
let socket = NamedTempFile::new().unwrap();
let socket = Arc::new(socket.into_temp_path());
std::fs::remove_file(&*socket).unwrap();
let uds = UnixListener::bind(&*socket).unwrap();
let stream = UnixListenerStream::new(uds);
// We would just listen on TCP, but it seems impossible to know when tonic is ready to serve
use crate::utils::{err, ColDbError};
use datafusion::arrow::array::{ArrayRef, Int32Array, StringArray};
use datafusion::arrow::datatypes::{DataType, Schema, SchemaRef};
use datafusion::arrow::record_batch::RecordBatch;
use std::ptr::slice_from_raw_parts_mut;
use std::sync::Arc;
use tokio::sync::Semaphore;
pub struct AppendableRecordBatch {
record_batch: RecordBatch,
use crate::utils::{err, ColDbError};
use datafusion::arrow::array::{ArrayRef, Int32Array, StringArray};
use datafusion::arrow::datatypes::{DataType, Schema, SchemaRef};
use datafusion::arrow::record_batch::RecordBatch;
use std::collections::HashMap;
use std::ptr::slice_from_raw_parts_mut;
use std::sync::Arc;
use tokio::sync::Semaphore;
pub struct AppendableRecordBatch {
{
"projection": {
"input": {
"sort": {
"input": {
"projection": {
"input": {
"listingScan": {
"tableName": "alltypes_plain",
"paths": [
-------- cat=DebugCategory("GST_REGISTRY") level=Log tag=../gst/gstregistry.c func=gst_registry_scan_path_level sz=1300 obj=Some(Object { inner: ObjectRef { inner: 0x7f7a098960, type: GstRegistry } }) dgb=DebugMessage(Some("file /data/app/example.com-1/lib/arm64/libgstandroidmedia.so looks like a possible module"))
-------- cat=DebugCategory("GST_REGISTRY") level=Debug tag=../gst/gstregistry.c func=gst_registry_scan_path_level sz=1361 obj=Some(Object { inner: ObjectRef { inner: 0x7f7a098960, type: GstRegistry } }) dgb=DebugMessage(Some("file /data/app/example.com-1/lib/arm64/libgstandroidmedia.so not yet in registry"))
-------- cat=DebugCategory("GST_PLUGIN_LOADING") level=Debug tag=../gst/gstplugin.c func=_priv_gst_plugin_load_file_for_registry sz=768 obj=None dgb=DebugMessage(Some("attempt to load plugin \"/data/app/example.com-1/lib/arm64/libgstandroidmedia.so\""))
I/rust: -------- cat=DebugCategory("GST_PLUGIN_LOADING") level=Log tag=../gst/gstplugin.c func=_priv_gst_plugin_load_file_for_regis
0000000000040c28 d aac_profile_mapping_table
00000000000424d0 b ahc_debug
0000000000042948 b ahs_debug
00000000000160b8 t _amc_gl_copy
0000000000016224 t _amc_gl_free
00000000000166b4 t _amc_gl_iterate_queue_unlocked
000000000001733c t _amc_gl_render_on_free
0000000000015ffc t _amc_gl_set_sync
0000000000016000 t _amc_gl_wait
000000000001666c t _amc_gl_wait_gl
@avantgardnerio
avantgardnerio / gist:ac04894a797f047aa0df1f5397be5090
Created August 22, 2020 19:50
ever write a piece of code even you don't understand?
pub fn pivot_uvc_fmt_hdr(node: &TreeNode, new_node: &mut TreeNode, idx: &mut usize) {
let len = node.children.len();
while *idx < len {
// Shallow clone each child
let child = &node.children[*idx];
let mut new_child = child.clone();
new_child.children.truncate(0);
if let DescriptorTypes::DescriptorUvcFormatMjpeg(_) | DescriptorTypes::DescriptorUvcFormatUncompressed(_) = &new_node.parsed {
match &child.parsed {
[ 1.754230] ohci-exynos: OHCI EXYNOS driver
[ 1.759872] usbcore: registered new interface driver usb-storage
[ 1.763560] usbcore: registered new interface driver usbserial
[ 1.769627] usbcore: registered new interface driver usbserial_generic
[ 1.775270] usbserial: USB Serial support registered for generic
[ 1.785456] i2c /dev entries driver
[ 1.796123] cpufreq: cpufreq_online: CPU0: Running at unlisted freq: 614400 KHz
[ 1.796300] cpufreq: cpufreq_online: CPU0: Unlisted initial frequency changed to: 652800 KHz
[ 1.803475] cpufreq: cpufreq_online: CPU2: Running at unlisted freq: 19200 KHz
[ 1.811024] cpufreq: cpufreq_online: CPU2: Unlisted initial frequency changed to: 307200 KHz