Skip to content

Instantly share code, notes, and snippets.

@ndimiduk
ndimiduk / pom.xml
Last active February 23, 2024 09:33
Effective POM 7be588e0d4
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- -->
<!-- Generated by Maven Help Plugin -->
<!-- See: https://maven.apache.org/plugins/maven-help-plugin/ -->
<!-- -->
<!-- ====================================================================== -->
<projects>
<!-- ====================================================================== -->
<!-- -->
@ndimiduk
ndimiduk / demo.html
Created May 21, 2021 20:23
Demoing Region Visualizer
<!DOCTYPE html>
<!--
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
@ndimiduk
ndimiduk / demo.sh
Last active April 17, 2024 01:13
Demonstrating the effect of JVM arg -XX:-MaxFDLimit on OSX
$ cat /Library/LaunchDaemons/limit.maxfiles.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
<array>
<string>launchctl</string>
@ndimiduk
ndimiduk / drop_empty_regions.rb
Last active February 9, 2023 08:47
Drop all empty regions for a table. Dropping a region is implemented as a merge into an adjacent region.
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); 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
@ndimiduk
ndimiduk / OutputFormatAdapter.java
Last active February 8, 2016 18:40
Flink: Use an OutputFormat in place of a SinkFunction
/** Use an {@link OutputFormat} in place of a {@link SinkFunction}. */
public class OutputFormatAdapter<T> extends RichSinkFunction<T> implements InputTypeConfigurable {
private final OutputFormat<T> delegate;
private final RichOutputFormat<T> richDelegate;
public OutputFormatAdapter(OutputFormat<T> delegate) {
this.delegate = delegate;
this.richDelegate = (this.delegate instanceof RichOutputFormat)
? (RichOutputFormat<T>) delegate
@ndimiduk
ndimiduk / MyTest.java
Created November 12, 2015 19:23
flink-it collection sink
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.sink.SinkFunction;
import org.apache.flink.streaming.util.StreamingMultipleProgramsTestBase;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@ndimiduk
ndimiduk / commands.sh
Last active February 22, 2022 07:50
queue sheet for creating HBase release candidates from branch-1.1
# in local sandbox:
## check compatibility report
git checkout master
GETOPT=/usr/local/Cellar/gnu-getopt/1.1.6/bin/getopt ./dev-support/check_compatibility.sh -r https://git-wip-us.apache.org/repos/asf/hbase.git 1.1.0 branch-1.1
open open dev-support/target/compatibility/report/1.1.0_branch-1.1_compat_report.html
## verify src tgz builds (this one is fragile)
@ndimiduk
ndimiduk / Example 1
Created November 18, 2014 16:43
Before and after examples of using the HBase DataType API
/*
* Before and after examples based on extracts from the UserDAO in HBase In Action
* https://github.com/hbaseinaction/twitbase/blob/master/src/main/java/HBaseIA/TwitBase/hbase/UsersDAO.java
*/
//
// Using raw byte[]'s directly.
//
private static Put mkPut(User u) {
@ndimiduk
ndimiduk / parse_IntegrationTestRegionReplicaPerf.py
Created October 24, 2014 21:54
Parse the log output produced by IntegrationTestRegionReplicaPerf for latency summary data
#!/usr/bin/env python
#
# parse the log output produced by IntegrationTestRegionReplicaPerf to
# collect the latency data from each client thread. Works on some build of
# 0.98 + region replicas.
#
import fileinput
import re
package bufperf;
import sun.nio.ch.DirectBuffer;
import java.lang.reflect.Field;
import java.nio.Buffer;
import java.nio.ByteBuffer;
public class DirectByteBufferUtils {
static final Field buffer_address;