コード例 #1
0
func newMockIndexOutputWrapper(dir *MockDirectoryWrapper, name string, delegate store.IndexOutput) *MockIndexOutputWrapper {
	assert(delegate != nil)
	ans := &MockIndexOutputWrapper{
		dir:        dir,
		name:       name,
		delegate:   delegate,
		first:      true,
		singleByte: make([]byte, 1),
	}
	ans.IndexOutputImpl = store.NewIndexOutput(ans)
	return ans
}
コード例 #2
0
ファイル: throttled.go プロジェクト: kiskovacs/golucene
func (out *ThrottledIndexOutput) NewFromDelegate(output store.IndexOutput) *ThrottledIndexOutput {
	ans := &ThrottledIndexOutput{
		delegate:         output,
		bytesPerSecond:   out.bytesPerSecond,
		flushDelayMillis: out.flushDelayMillis,
		closeDelayMillis: out.closeDelayMillis,
		seekDelayMillis:  out.seekDelayMillis,
		minBytesWritten:  out.minBytesWritten,
		bytes:            make([]byte, 1),
	}
	ans.IndexOutputImpl = store.NewIndexOutput(ans)
	return ans
}
コード例 #3
0
ファイル: throttled.go プロジェクト: kiskovacs/golucene
func NewThrottledIndexOutput(bytesPerSecond int, delayInMillis int64, delegate store.IndexOutput) *ThrottledIndexOutput {
	assert(bytesPerSecond > 0)
	ans := &ThrottledIndexOutput{
		delegate:         delegate,
		bytesPerSecond:   bytesPerSecond,
		flushDelayMillis: delayInMillis,
		closeDelayMillis: delayInMillis,
		seekDelayMillis:  delayInMillis,
		minBytesWritten:  DEFAULT_MIN_WRITTEN_BYTES,
		bytes:            make([]byte, 1),
	}
	ans.IndexOutputImpl = store.NewIndexOutput(ans)
	return ans
}