You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2017/03/07 19:21:49 UTC
[26/51] [abbrv] geode git commit: GEODE-880 Remove unused classes
GEODE-880 Remove unused classes
This closes #409
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/4fbc6412
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/4fbc6412
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/4fbc6412
Branch: refs/heads/feature/GEM-1195
Commit: 4fbc6412f7daf82586ce3b80a6c7aeb0d93a781e
Parents: bc32a76
Author: Anthony Baker <ab...@apache.org>
Authored: Mon Feb 27 22:04:46 2017 -0800
Committer: Kirk Lund <kl...@apache.org>
Committed: Tue Feb 28 14:32:53 2017 -0800
----------------------------------------------------------------------
.../org/apache/geode/internal/JavaExec.java | 71 ---------------
.../org/apache/geode/internal/LongBuffer.java | 96 --------------------
2 files changed, 167 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/4fbc6412/geode-core/src/test/java/org/apache/geode/internal/JavaExec.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/JavaExec.java b/geode-core/src/test/java/org/apache/geode/internal/JavaExec.java
deleted file mode 100644
index 7803d5d..0000000
--- a/geode-core/src/test/java/org/apache/geode/internal/JavaExec.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.geode.internal;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Used to exec a java main class in its own vm
- *
- *
- */
-public class JavaExec {
- /**
- * Creates a java process that executes the given main class and waits for the process to
- * terminate.
- *
- * @return a {@link ProcessOutputReader} that can be used to get the exit code and stdout+stderr
- * of the terminated process.
- */
- public static ProcessOutputReader fg(Class main) throws IOException {
- return fg(main, null, null);
- }
-
- /**
- * Creates a java process that executes the given main class and waits for the process to
- * terminate.
- *
- * @return a {@link ProcessOutputReader} that can be used to get the exit code and stdout+stderr
- * of the terminated process.
- */
- public static ProcessOutputReader fg(Class main, String[] vmArgs, String[] mainArgs)
- throws IOException {
- File javabindir = new File(System.getProperty("java.home"), "bin");
- File javaexe = new File(javabindir, "java");
-
- int bits = Integer.getInteger("sun.arch.data.model", 0).intValue();
- String vmKindArg = (bits == 64) ? "-d64" : null;
-
- ArrayList argList = new ArrayList();
- argList.add(javaexe.getPath());
- if (vmKindArg != null) {
- argList.add(vmKindArg);
- }
- // argList.add("-Dgemfire.systemDirectory=" +
- // GemFireConnectionFactory.getDefaultSystemDirectory());
- argList.add("-Djava.class.path=" + System.getProperty("java.class.path"));
- argList.add("-Djava.library.path=" + System.getProperty("java.library.path"));
- if (vmArgs != null) {
- argList.addAll(Arrays.asList(vmArgs));
- }
- argList.add(main.getName());
- if (mainArgs != null) {
- argList.addAll(Arrays.asList(mainArgs));
- }
- String[] cmd = (String[]) argList.toArray(new String[argList.size()]);
- return new ProcessOutputReader(Runtime.getRuntime().exec(cmd));
- }
-}
http://git-wip-us.apache.org/repos/asf/geode/blob/4fbc6412/geode-core/src/test/java/org/apache/geode/internal/LongBuffer.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/LongBuffer.java b/geode-core/src/test/java/org/apache/geode/internal/LongBuffer.java
deleted file mode 100644
index addd5ea..0000000
--- a/geode-core/src/test/java/org/apache/geode/internal/LongBuffer.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.geode.internal;
-
-public class LongBuffer {
-
- private long data[]; // the array implementing the buffer
- public int length; // number of valid elements in the buffer,
- // data[0.. this.length-1 ] are the valid elements
-
- /** construct a new instance of the specified capacity */
- LongBuffer(int size) {
- data = new long[size];
- length = 0;
- }
-
- /** construct a new instance, installing the argument as the data array */
- LongBuffer(long[] someIds) {
- data = someIds;
- length = someIds.length;
- }
-
- /** change the capacity to the specified size, without loosing elements */
- private void changeSize(int newSize) {
- if (newSize >= length) { // only change size if we won't loose data
- long[] oldData = data;
- int oldLength = length;
- data = new long[newSize];
- length = 0;
- add(oldData, oldLength);
- }
- }
-
-
- public synchronized void add(long id) {
- if (length >= data.length) {
- // if buffer is large, don't double to reduce out-of-mem problems
- if (length > 10000)
- changeSize(length + 2000);
- else
- changeSize(length * 2);
- }
- data[length++] = id;
- }
-
- /** add argIds[0..argLength] , growing as required */
- public synchronized void add(long[] argIds, int argLength) {
- if (length + argLength > data.length) {
- long[] oldData = data;
- data = new long[argLength + length];
- System.arraycopy(oldData, 0, data, 0, oldData.length);
- }
- System.arraycopy(argIds, 0, data, length, argLength);
- length += argLength;
- }
-
- /** add all of argIds, growing as required */
- public synchronized void add(long[] argIds) {
- add(argIds, argIds.length);
- }
-
- /** add all elements in the argument, growing as required */
- public synchronized void add(LongBuffer argBuf) {
- add(argBuf.data, argBuf.length);
- }
-
- public synchronized long get(int index) {
- if (index >= length)
- throw new IndexOutOfBoundsException(" index " + index + " length " + length);
- return data[index];
- }
-
- public synchronized long getAndStore(int index, int newValue) {
- if (index >= length)
- throw new IndexOutOfBoundsException(" index " + index + " length " + length);
- long result = data[index];
- data[index] = newValue;
- return result;
- }
-
- public synchronized void clear() {
- length = 0;
- }
-}