문서
이 페이지의 최신 내용은 아직 번역되지 않았습니다. 최신 내용은 영문으로 볼 수 있습니다.
데이터저장소 파티션 개수
n = numpartitions(ds)
n = numpartitions(ds,pool)
예제
n = numpartitions(ds)는 데이터저장소 ds에 대한 디폴트 파티션 개수를 반환합니다.
ds
n = numpartitions(ds,pool)은 pool로 지정된 병렬 풀에서 데이터저장소 액세스를 병렬 처리할 파티션 개수를 반환합니다. 데이터저장소 액세스를 병렬 처리하려면 Parallel Computing Toolbox™가 설치되어 있어야 합니다.
pool
모두 축소
샘플 파일 mapredout.mat에서 데이터저장소를 만듭니다. 이 파일은 mapreduce 함수의 출력 파일입니다.
mapredout.mat
mapreduce
ds = datastore('mapredout.mat');
디폴트 파티션 개수를 가져옵니다.
n = 1
기본적으로 ds에는 하나의 작은 파일만 포함되므로 하나의 파티션만 있습니다.
데이터저장소를 파티셔닝하고 첫 번째 파트에 대응하는 데이터저장소를 반환합니다.
subds = partition(ds,n,1);
subds에서 데이터를 읽습니다.
subds
while hasdata(subds) data = read(subds); end
현재 병렬 풀에서 데이터저장소 액세스를 병렬 처리할 파티션 개수를 가져옵니다. Parallel Computing Toolbox가 설치되어 있어야 합니다.
현재 병렬 풀에서 데이터저장소 액세스를 병렬 처리할 파티션 개수를 가져옵니다.
n = numpartitions(ds, gcp);
데이터저장소를 파티셔닝하고 각 파트에서 데이터를 읽습니다.
parfor ii=1:n subds = partition(ds,n,ii); while hasdata(subds) data = read(subds); end end
입력 데이터저장소입니다. datastore 함수를 사용하여 데이터에서 datastore 객체를 만들 수 있습니다.
datastore
병렬 풀 객체입니다.
예: gcp
gcp
datastore | partition
partition
A modified version of this example exists on your system. Do you want to open this version instead? (ko_KR)
아래 MATLAB 명령에 해당하는 링크를 클릭하셨습니다.
이 명령을 MATLAB 명령 창에 입력해 실행하십시오. 웹 브라우저에서는 MATLAB 명령을 지원하지 않습니다.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office