/**
 * Copyright 2014 Grafos.ml
 *
 * Licensed 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 ml.grafos.okapi.spinner;

import org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;
import org.apache.giraph.partition.GraphPartitionerFactory;
import org.apache.giraph.partition.HashMasterPartitioner;
import org.apache.giraph.partition.MasterGraphPartitioner;
import org.apache.giraph.partition.WorkerGraphPartitioner;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableComparable;

/*
 * set it through giraph.graphPartitionerFactoryClass
 * expects I as PrefixIntWritable
 */
@SuppressWarnings("rawtypes")
public class PrefixHashPartitionerFactory<I extends WritableComparable, V extends Writable, E extends Writable>
		implements GraphPartitionerFactory<I, V, E> {
	/** Saved configuration */
	private ImmutableClassesGiraphConfiguration conf;

	@Override
	public MasterGraphPartitioner<I, V, E> createMasterGraphPartitioner() {
		return new HashMasterPartitioner<I, V, E>(getConf());
	}

	@Override
	public WorkerGraphPartitioner<I, V, E> createWorkerGraphPartitioner() {
		return new PrefixHashWorkerPartitioner<I, V, E>();
	}

	@Override
	public ImmutableClassesGiraphConfiguration getConf() {
		return conf;
	}

	@Override
	public void setConf(ImmutableClassesGiraphConfiguration conf) {
		this.conf = conf;
	}
}

@@ -916,32 +916,75 @@
 aphPartitioner;%0A
+import org.apache.giraph.worker.LocalData;%0A
 import org.apach
@@ -1060,17 +1060,17 @@
 %0A%0A/*%0A * 
-s
+S
 et it th
@@ -1888,11 +1888,103 @@
 conf;%0A%09%7D
+%0A%0A  @Override%0A  public void initialize(LocalData%3CI, V, E, ? extends Writable%3E localData) %7B %7D
 %0A%7D%0A

Fix in PrefixHashPartitionerFactory, compatibility with latest Giraph