mirror of https://github.com/apache/cassandra
really remove unused continuations code
git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/branches/cassandra-0.4@812696 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
42e451b33d
commit
329f642c34
|
|
@ -1,52 +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.cassandra.concurrent;
|
||||
|
||||
import org.apache.commons.javaflow.Continuation;
|
||||
|
||||
public class ContinuationContext
|
||||
{
|
||||
private Continuation continuation_;
|
||||
private Object result_;
|
||||
|
||||
public ContinuationContext(Continuation continuation)
|
||||
{
|
||||
continuation_ = continuation;
|
||||
}
|
||||
|
||||
public Continuation getContinuation()
|
||||
{
|
||||
return continuation_;
|
||||
}
|
||||
|
||||
public void setContinuation(Continuation continuation)
|
||||
{
|
||||
continuation_ = continuation;
|
||||
}
|
||||
|
||||
public Object result()
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
public void result(Object result)
|
||||
{
|
||||
result_ = result;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,89 +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.cassandra.concurrent;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
public class ContinuationStage implements IStage
|
||||
{
|
||||
private String name_;
|
||||
private ContinuationsExecutor executorService_;
|
||||
|
||||
public ContinuationStage(String name, int numThreads)
|
||||
{
|
||||
name_ = name;
|
||||
executorService_ = new ContinuationsExecutor( numThreads,
|
||||
numThreads,
|
||||
Integer.MAX_VALUE,
|
||||
TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<Runnable>(),
|
||||
new ThreadFactoryImpl(name)
|
||||
);
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
public ExecutorService getInternalThreadPool()
|
||||
{
|
||||
return executorService_;
|
||||
}
|
||||
|
||||
public Future<Object> execute(Callable<Object> callable) {
|
||||
return executorService_.submit(callable);
|
||||
}
|
||||
|
||||
public void execute(Runnable runnable) {
|
||||
executorService_.execute(runnable);
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
|
||||
{
|
||||
throw new UnsupportedOperationException("This operation is not supported");
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit) {
|
||||
throw new UnsupportedOperationException("This operation is not supported");
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit) {
|
||||
throw new UnsupportedOperationException("This operation is not supported");
|
||||
}
|
||||
|
||||
public void shutdown() {
|
||||
executorService_.shutdownNow();
|
||||
}
|
||||
|
||||
public boolean isShutdown()
|
||||
{
|
||||
return executorService_.isShutdown();
|
||||
}
|
||||
|
||||
public long getPendingTasks(){
|
||||
return (executorService_.getTaskCount() - executorService_.getCompletedTaskCount());
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,26 +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.cassandra.concurrent;
|
||||
|
||||
import org.apache.commons.javaflow.Continuation;
|
||||
|
||||
public interface IContinuable
|
||||
{
|
||||
public void run(Continuation c);
|
||||
}
|
||||
|
|
@ -1,24 +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.cassandra.concurrent;
|
||||
|
||||
interface RejectedExecutionHandler
|
||||
{
|
||||
public void rejectedExecution(Runnable r, ContinuationsExecutor executor);
|
||||
}
|
||||
|
|
@ -1,100 +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.cassandra.concurrent;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class SingleThreadedContinuationStage implements IStage
|
||||
{
|
||||
protected ContinuationsExecutor executorService_;
|
||||
private String name_;
|
||||
|
||||
public SingleThreadedContinuationStage(String name)
|
||||
{
|
||||
executorService_ = new ContinuationsExecutor( 1,
|
||||
1,
|
||||
Integer.MAX_VALUE,
|
||||
TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<Runnable>(),
|
||||
new ThreadFactoryImpl(name)
|
||||
);
|
||||
name_ = name;
|
||||
}
|
||||
|
||||
/* Implementing the IStage interface methods */
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
public ExecutorService getInternalThreadPool()
|
||||
{
|
||||
return executorService_;
|
||||
}
|
||||
|
||||
public void execute(Runnable runnable)
|
||||
{
|
||||
executorService_.execute(runnable);
|
||||
}
|
||||
|
||||
public Future<Object> execute(Callable<Object> callable)
|
||||
{
|
||||
return executorService_.submit(callable);
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
|
||||
{
|
||||
//return executorService_.schedule(command, delay, unit);
|
||||
throw new UnsupportedOperationException("This operation is not supported");
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
|
||||
{
|
||||
//return executorService_.scheduleAtFixedRate(command, initialDelay, period, unit);
|
||||
throw new UnsupportedOperationException("This operation is not supported");
|
||||
}
|
||||
|
||||
public ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
|
||||
{
|
||||
//return executorService_.scheduleWithFixedDelay(command, initialDelay, delay, unit);
|
||||
throw new UnsupportedOperationException("This operation is not supported");
|
||||
}
|
||||
|
||||
public void shutdown()
|
||||
{
|
||||
executorService_.shutdownNow();
|
||||
}
|
||||
|
||||
public boolean isShutdown()
|
||||
{
|
||||
return executorService_.isShutdown();
|
||||
}
|
||||
|
||||
public long getPendingTasks(){
|
||||
return (executorService_.getTaskCount() - executorService_.getCompletedTaskCount());
|
||||
}
|
||||
/* Finished implementing the IStage interface methods */
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue