From ad36c9ad66bd41bbea01f56aaba8e9446787ecc6 Mon Sep 17 00:00:00 2001 From: Sijie Guo Date: Tue, 23 Feb 2016 10:51:38 -0800 Subject: [PATCH 1/2] fix --- .../main/java/org/apache/bookkeeper/bookie/BookieShell.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java index fca2164e117..c7ed2f8a095 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieShell.java @@ -733,7 +733,7 @@ int runCmd(CommandLine cmdLine) throws Exception { for (int i = 0; i < numberOfEntries; i++) { String content = "entry-" + i; - lh.addEntry(content.getBytes()); + lh.addEntry(content.getBytes(UTF_8)); } LOG.info("Written {} entries in ledger {}", numberOfEntries, lh.getId()); @@ -749,7 +749,7 @@ int runCmd(CommandLine cmdLine) throws Exception { int i = 0; while (entries.hasMoreElements()) { LedgerEntry entry = entries.nextElement(); - String actualMsg = new String(entry.getEntry()); + String actualMsg = new String(entry.getEntry(), UTF_8); String expectedMsg = "entry-" + (i++); if (!expectedMsg.equals(actualMsg)) { throw new Exception("Failed validation of received message - Expected: " + expectedMsg From cee48860fdead3da1704d627eaead44f4c33a3e2 Mon Sep 17 00:00:00 2001 From: Sijie Guo Date: Tue, 23 Feb 2016 11:29:21 -0800 Subject: [PATCH 2/2] Added missing apache license header --- .../LocalBookieEnsemblePlacementPolicy.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LocalBookieEnsemblePlacementPolicy.java b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LocalBookieEnsemblePlacementPolicy.java index d1c41dd4f58..2b180294b9e 100644 --- a/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LocalBookieEnsemblePlacementPolicy.java +++ b/bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LocalBookieEnsemblePlacementPolicy.java @@ -1,3 +1,20 @@ +/* + * 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 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.bookkeeper.bookie; import java.net.UnknownHostException;