public void getInitialCentroidsFromFuzzyCentroidsDB() { String[] serilizedCentroids = CCentroidsDatabase.getSerializedClusterMap(); for (int i = 0; i < serilizedCentroids.length; i++) { try { vectors.put( i, Storm.Databases.Functions.SerializeAndDeserializeJavaObjects .deserializeJavaDoublesVector(serilizedCentroids[i])); } catch (Exception ex) { ex.printStackTrace(); } } }
public void updateDB(int index, double[] vectorForUpdate) { String serializedVectors = Storm.Databases.Functions.SerializeAndDeserializeJavaObjects.serializeJavaDoublesVector( vectorForUpdate); CCentroidsDatabase.setSerializedMap(index, serializedVectors); }