Skip to content

Instantly share code, notes, and snippets.

View yukim's full-sized avatar

Yuki Morishita yukim

View GitHub Profile
/*
* 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
@yukim
yukim / metrics.md
Created June 28, 2012 18:27
Cassandra Metrics (CASSANDRA-4009)

Cassandra Metrics

ATTENTION!: This page describes new metrics(CASSANDRA-4009) planned in upcoming version 1.2, which is still under development.

Overview

Apache Cassandra version 1.1 introduced metrics using Codahale's Metrics library. The library enables easier exposure of metrics and integration with other systems. What you can get from metrics are basically the same with 1.1 but reimplemented and put them in order using Metrics library. You can still query using old JMX paths,

From 01018acd8f8c2460f94138a6e73dcf399e5bd92e Mon Sep 17 00:00:00 2001
From: Yuki Morishita <yukim@apache.org>
Date: Fri, 27 Jul 2012 10:11:18 -0500
Subject: [PATCH] use slf4j api instead of log4j
---
src/java/org/apache/cassandra/db/CounterColumn.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/java/org/apache/cassandra/db/CounterColumn.java b/src/java/org/apache/cassandra/db/CounterColumn.java
diff --git a/src/java/org/apache/cassandra/net/MessagingService.java b/src/java/org/apache/cassandra/net/MessagingService.java
index cb58314..553301d 100644
--- a/src/java/org/apache/cassandra/net/MessagingService.java
+++ b/src/java/org/apache/cassandra/net/MessagingService.java
@@ -469,11 +469,7 @@ public final class MessagingService implements MessagingServiceMBean
OutboundTcpConnectionPool cp = connectionManagers.get(to);
if (cp == null)
return;
- // these null guards are simply for tests
- if (cp.ackCon != null)
@yukim
yukim / patch.txt
Created November 20, 2012 18:06
Initialized flag need to set to true
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 0206f40..17b21d9 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -410,6 +410,7 @@ public class StorageService implements IEndpointStateChangeSubscriber, StorageSe
throw new UnsupportedOperationException("StorageService does not support switching modes.");
return;
}
+ initialized = true;
isClientMode = false;
Manifest-Version: 1.0
Premain-Class: com.datastax.example.ReportAgent
@yukim
yukim / re.md
Created March 4, 2013 23:05
RE:cassandraを運用していて困っていること

@oranie さんのブログ記事への返信です。 たいへん遅くなりました。申し訳ないです。

repairとcompactionのコストが高すぎる

Cassandraにノードを追加する(Bootstrap)と、そのノードが担当するレプリカのデータを他のノードから取得します。 Repairはノードが保持するレプリカの整合性を検証して修復します。

どちらもデータを他のノードから取得しますが、ファイルを1つづつやり取りするため時間がかかるのは事実です。 この部分にまだまだ改善の余地があります。次のメジャーバージョンで抜本的に見直します

@yukim
yukim / CASSANDRA-5286.md
Created May 29, 2013 18:22
CASSANDRA-5286 New Streaming API design doc

Apache Cassandra Streaming API(CASSANDRA-5286)

Design goal

  • Better control
    • One API for all (bootstrap, move, bulkload, repair...)
    • IN/OUT in one session
    • Event notification
  • Better performance
  • Pipelined stream
@yukim
yukim / gist:8245030
Created January 3, 2014 19:39
Fix for possible endless lock in CLSM
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java
index 4275362..815616b 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManager.java
@@ -288,10 +288,9 @@ public class CommitLogSegmentManager
advanceAllocatingFrom(last);
// flush and wait for all CFs that are dirty in segments up-to and including 'last'
- Future<?> future = flushDataFrom(segmentsToRecycle);
try
@yukim
yukim / EWMATest.java
Created March 5, 2014 17:20
CASSANDRA-6591 EWMA test
package org.apache.cassandra;
import java.util.concurrent.TimeUnit;
import com.yammer.metrics.stats.EWMA;
import static java.lang.Math.exp;
public class EWMATest
{