-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Merge should work with a regex #72
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
465614c
Modify merge to work with regex
jvshahid a9d9230
More logging
jvshahid 78b99f6
Merge points at the shard level
jvshahid 7839677
Return the merged data using the alias
jvshahid e8be757
rename a test file
jvshahid 911e1b9
Use the standard heap implementation
jvshahid 44643de
make sure we close the point iterators
jvshahid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package cluster | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/influxdb/influxdb/engine" | ||
"github.com/influxdb/influxdb/protocol" | ||
) | ||
|
||
// A processor to set the ShardId on the series to `id` | ||
type ShardIdInserterProcessor struct { | ||
id uint32 | ||
next engine.Processor | ||
} | ||
|
||
func NewShardIdInserterProcessor(id uint32, next engine.Processor) ShardIdInserterProcessor { | ||
return ShardIdInserterProcessor{id, next} | ||
} | ||
|
||
func (sip ShardIdInserterProcessor) Yield(s *protocol.Series) (bool, error) { | ||
s.ShardId = &sip.id | ||
return sip.next.Yield(s) | ||
} | ||
|
||
func (sip ShardIdInserterProcessor) Close() error { | ||
return sip.next.Close() | ||
} | ||
|
||
func (sip ShardIdInserterProcessor) Name() string { | ||
return fmt.Sprintf("ShardIdInserterProcessor (%d)", sip.id) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package datastore | ||
|
||
import "github.com/influxdb/influxdb/protocol" | ||
|
||
// PointIteratorStream is a struct that implements the StreamQuery | ||
// interface and is used by the shard with the Merger to merge the | ||
// data points locally to form a monotic stream of points (increasing | ||
// or decreasing timestamps) | ||
type PointIteratorStream struct { | ||
pi *PointIterator | ||
name string | ||
fields []string | ||
} | ||
|
||
// Returns true if the point iterator is still valid | ||
func (pis PointIteratorStream) HasPoint() bool { | ||
return pis.pi.Valid() | ||
} | ||
|
||
// Returns the next point from the point iterator | ||
func (pis PointIteratorStream) Next() *protocol.Series { | ||
p := pis.pi.Point() | ||
s := &protocol.Series{ | ||
Name: &pis.name, | ||
Fields: pis.fields, | ||
Points: []*protocol.Point{p}, | ||
} | ||
pis.pi.Next() | ||
return s | ||
} | ||
|
||
// Returns true if the point iterator is not valid | ||
func (pis PointIteratorStream) Closed() bool { | ||
return !pis.pi.Valid() | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not using "self" because the receiver isn't a pointer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not idomatic to use
self
in go code, i'm trying to slowly remove all uses ofself
and replace them with short names, e.g. the initials of the structure.