Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrator seems to no longer work. #25

Open
fake-name opened this issue Jan 4, 2018 · 1 comment
Open

Migrator seems to no longer work. #25

fake-name opened this issue Jan 4, 2018 · 1 comment

Comments

@fake-name
Copy link

durr@graphical:~/whisper-migrator$ go run migration.go -wspinfo -wspPath=/tank/carbon/whisper/
# command-line-arguments
./migration.go:515:38: cannot use tsmPoint.key (type string) as type []byte in argument to tsmWriter.Write

I'm not familiar with go at all, so I can't really help fix.

@fake-name
Copy link
Author

Ok, seems like it's at least partially fixed by:


durr@graphical:~/whisper-migrator$ git diff
diff --git a/migration.go b/migration.go
old mode 100644
new mode 100755
index 6b70a9c..e5c0104
--- a/migration.go
+++ b/migration.go
@@ -60,7 +60,7 @@ type MigrationData struct {
 }

 type TsmPoint struct {
-       key    string
+       key    []byte
        values []tsm1.Value
 }

@@ -113,6 +113,7 @@ func main() {
                        return
                }
                if err := migrationData.GetWhisperInfo(); err != nil {
+                       log.Fatal(err)
                        fmt.Println("Error in Getting Whisper File information")
                }
                return
@@ -550,7 +551,7 @@ func (migrationData *MigrationData) WriteTSMPoints(filename string,
 }

 //Create TSM Key from measurement, tags and field
-func CreateTSMKey(mtf *MTF) string {
+func CreateTSMKey(mtf *MTF) []byte {
        key := mtf.Measurement
        if len(mtf.Tags) > 0 {
                for _, tagKeyValue := range mtf.Tags {
@@ -558,7 +559,7 @@ func CreateTSMKey(mtf *MTF) string {
                        key = key + tagKeyValue.Tagkey + "=" + tagKeyValue.Tagvalue
                }
        }
-       return key + "#!~#" + mtf.Field
+       return []byte(key + "#!~#" + mtf.Field)
 }

 // Get measurement, tags and field by matching the whisper filename with a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant