func generateTestData(t *testing.T) { r0, c0, r1, c1 := getShards() fs := filesystem.NewLocalFSClient() wr0Err := bwmf.SaveMatrixShard(fs, r0, "../.tmp/row_shard.dat-000000") wr1Err := bwmf.SaveMatrixShard(fs, r1, "../.tmp/row_shard.dat-000001") wc0Err := bwmf.SaveMatrixShard(fs, c0, "../.tmp/column_shard.dat-000000") wc1Err := bwmf.SaveMatrixShard(fs, c1, "../.tmp/column_shard.dat-000001") if wr0Err != nil || wr1Err != nil || wc0Err != nil || wc1Err != nil { t.Errorf("Failed generating test data files: %s;%s;%s;%s.", wr0Err, wr1Err, wc0Err, wc1Err) } }
func saveResult(shard *pb.MatrixShard, config *bwmf.Config, path string) error { client, err := bwmf.GetFsClient(config) if err != nil { return fmt.Errorf("Failed getting filesystem.Client: %s", err) } return bwmf.SaveMatrixShard(client, shard, path) }