示例#1
0
文件: ddfs.py 项目: nicolasramy/disco
 def chunk_iter(replicas):
     chunker = Chunker(chunk_size=chunk_size, max_record_size=max_record_size)
     return chunker.chunks(result_iterator([replicas], **kwargs))
示例#2
0
文件: ddfs.py 项目: wquan/disco
 def chunk_iter(replicas):
     chunker = Chunker(chunk_size=chunk_size)
     return chunker.chunks(classic_iterator([replicas], **kwargs))
示例#3
0
 def chunk_iter(replicas):
     chunker = Chunker(chunk_size=chunk_size)
     return chunker.chunks(classic_iterator([replicas], **kwargs))
 def test_less_than_a_hunk(self):
     records = _sizelimitedinput(HUNK_SIZE / 2)
     chunker = Chunker(chunk_size=HUNK_SIZE * 2)
     chunks = list(chunker.chunks(records))
     self.assertEqual(len(chunks), 1)
 def test_more_than_a_hunk(self):
     chunk_size = HUNK_SIZE * 2
     records = _sizelimitedinput(chunk_size)
     chunker = Chunker(chunk_size=chunk_size)
     chunks = list(chunker.chunks(records))
     self.assertEqual(len(chunks), 1)
示例#6
0
 def test_more_than_a_hunk(self):
     chunk_size = HUNK_SIZE * 2
     records = _sizelimitedinput(chunk_size)
     chunker = Chunker(chunk_size=chunk_size)
     chunks = list(chunker.chunks(records))
     self.assertEqual(len(chunks), 1)
示例#7
0
 def test_less_than_a_hunk(self):
     records = _sizelimitedinput(HUNK_SIZE / 2)
     chunker = Chunker(chunk_size=HUNK_SIZE * 2)
     chunks = list(chunker.chunks(records))
     self.assertEqual(len(chunks), 1)
示例#8
0
文件: core.py 项目: mshron/disco
 def __iter__(self):
     chunker = Chunker(chunk_size=self.chunk_size)
     for chunk in chunker.chunks(RecordIter([self.url], **self.kwargs)):
         yield chunk
示例#9
0
 def chunk_iter(replicas):
     chunker = Chunker(chunk_size=chunk_size,
                       max_record_size=max_record_size)
     return chunker.chunks(result_iterator([replicas], **kwargs))
示例#10
0
文件: core.py 项目: JensRantil/disco
 def __iter__(self):
     chunker = Chunker(chunk_size=self.chunk_size)
     for chunk in chunker.chunks(RecordIter([self.url], **self.kwargs)):
         yield chunk