Skip to content

Instantly share code, notes, and snippets.

View avikivity's full-sized avatar
💭
Now you can set a status message about what you're currently doing on GitHub. Th

Avi Kivity avikivity

💭
Now you can set a status message about what you're currently doing on GitHub. Th
View GitHub Profile
#include <optional>
#include <string>
#include <random>
#include <ranges>
#include <functional>
using namespace std::literals::string_literals;
template <typename T>
class avi_optional {
{
"TableName": "Orders",
"Key": {
"orderId": {
"S": "order-12345"
}
},
"ConsistentRead": true,
"ReturnConsumedCapacity": "TOTAL",
"ProjectionExpression": "#oid, customerInfo.#name, #items[0], orderTotal, #status",
@avikivity
avikivity / expression.o.d
Created October 1, 2024 11:24
typical dependency list
build/dev/cql3/expr/expression.o: cql3/expr/expression.cc \
cql3/expr/expression.hh /usr/include/fmt/core.h \
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/cstddef \
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/x86_64-redhat-linux/bits/c++config.h \
/usr/include/bits/wordsize.h \
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
/usr/include/features.h /usr/include/features-time64.h \
/usr/include/bits/timesize.h /usr/include/stdc-predef.h \
/usr/include/sys/cdefs.h /usr/include/bits/long-double.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-64.h \
; *** IR Dump Before PGOInstrumentationUse on [module] ***
; ModuleID = 'rpc-195796.cpp'
source_filename = "rpc-195796.cpp"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-redhat-linux-gnu"
%"class.seastar::future" = type { %"class.seastar::internal::future_base", %"struct.seastar::future_state" }
%"class.seastar::internal::future_base" = type { ptr }
%"struct.seastar::future_state" = type <{ %"struct.seastar::future_state_base", %"struct.seastar::internal::uninitialized_wrapper", [3 x i8] }>
%"struct.seastar::future_state_base" = type { %"union.seastar::future_state_base::any" }
#7 0x00000000117bea43 in (anonymous namespace)::PGOUseFunc::setBranchWeights (this=0x7ffff5ded4f0) at /home/avi/llvm-project/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp:1587
1587 EdgeCounts[SuccNum] = EdgeCount;
(gdb) p BB.getParent()->dump()
; Function Attrs: mustprogress nounwind presplitcoroutine uwtable
define linkonce_odr hidden void @_ZN7seastar12input_streamIcE17read_exactly_partEm(ptr dead_on_unwind writable sret(%"class.seastar::future.0") align 8 %0, ptr noundef nonnull align 8 dereferenceable(25) %1, i64 noundef %2) #8 comdat align 2 personality ptr @__gxx_personality_v0 !dbg !491 !prof !505 !type !450 {
%4 = alloca %"class.seastar::internal::coroutine_traits_base<seastar::temporary_buffer<char>>::promise_type", align 8
%5 = alloca %"class.seastar::temporary_buffer", align 8
%6 = alloca %"class.seastar::temporary_buffer", align 8
%7 = alloca %"struct.seastar::internal::awaiter", align 8
%8 = alloca %"class.seastar::future.0", align 8
title Lazily learning routing information
note over Driver: Driver does not know where token T is routed
Driver->Node1:request for token T
activate Node1
Node1->Node2:read from replica
deactivate Node1
activate Node2
Node1<-Node2:data
deactivate Node2
mindmap
  root((mindmap))
    Origins
      Long history
      ::icon(fa fa-book)
      Popularisation
        British popular psychology author Tony Buzan
    Research
 On effectivenessand features
#!/bin/bash -ex
using_container=0
using_gdb=0
while [[ "$1" = -* ]]; do
case "$1" in
--container)
using_container=1; shift
;;

Protocol extensions to the Cassandra Native Protocol

This document specifies extensions to the protocol defined by Cassandra's native_protocol_v4.spec and native_protocol_v5.spec. The extensions are designed so that a driver supporting them can continue to interoperate with Cassandra and other compatible servers with no configuration needed; the driver can discover the extensions and enable them conditionally.

@avikivity
avikivity / noncopyable_function.hh
Created October 3, 2017 14:33
noncopyable_function.hh
/*
* This file is open source software, licensed to you under the terms
* of the Apache License, Version 2.0 (the "License"). See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. You may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*